diff --git a/next.config.js b/next.config.js index 713ec39..ffe2af3 100644 --- a/next.config.js +++ b/next.config.js @@ -11,6 +11,24 @@ const nextConfig = { // modern: true, // ✅ enable modern build (ES6+ for modern browsers) // polyfillsOptimization: true // ✅ remove unnecessary polyfills // }, + async headers() { + return [ + { + // ✅ Cache static assets for 1 year + source: "/:all*(woff2|ttf|eot|otf|jpg|jpeg|png|webp|svg|gif|css|js)", + headers: [ + { key: "Cache-Control", value: "public, max-age=31536000, immutable" }, + ], + }, + { + // ✅ Cache HTML for 10 mins + source: "/:all*(html)", + headers: [ + { key: "Cache-Control", value: "public, max-age=600, must-revalidate" }, + ], + }, + ]; + }, }; module.exports = nextConfig;