Merge pull request #25 from zonghaoyuan/perf/home-cache-headers

perf(web): pin /home/* assets to 1y immutable cache
This commit is contained in:
Zonghao Yuan
2026-06-04 10:04:27 +08:00
committed by GitHub
+11
View File
@@ -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;