Merge pull request #25 from zonghaoyuan/perf/home-cache-headers
perf(web): pin /home/* assets to 1y immutable cache
This commit is contained in:
@@ -6,6 +6,17 @@ const config: NextConfig = {
|
||||
turbopack: {
|
||||
root: __dirname,
|
||||
},
|
||||
// /public defaults to `max-age=0, must-revalidate`; pin the stable /home/* covers + first-act JSON for 1y so browsers/CDN stop re-downloading them.
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
source: "/home/:path*",
|
||||
headers: [
|
||||
{ key: "Cache-Control", value: "public, max-age=31536000, immutable" },
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
Reference in New Issue
Block a user