Little fix

This commit is contained in:
sijinhui 2024-04-08 08:49:17 +08:00
parent 1436e8df26
commit bb1ed984d6

View File

@ -102,17 +102,20 @@ const CorsHeaders = [
const IndexHeaders = [ const IndexHeaders = [
{ key: "Cache-Control", value: "public, max-age=86400"} { key: "Cache-Control", value: "public, max-age=86400"}
] ]
const ForceCacheHeaders = [
{ key: "Cache-Control", value: "max-age=2592000, s-maxage=86400"}
]
if (mode !== "export") { if (mode !== "export") {
nextConfig.headers = async () => { nextConfig.headers = async () => {
return [ return [
{ {
source: "/api/:path*", source: "/:path*\\.(png|ico|txt|css|js|json|webmanifest)",
headers: CorsHeaders, headers: ForceCacheHeaders,
}, },
// { // {
// source: "/", // source: "/api/:path*",
// headers: IndexHeaders, // headers: CorsHeaders,
// }, // },
]; ];
}; };