chache updated in next config

This commit is contained in:
Alaguraj0361 2025-10-29 23:00:03 +05:30
parent 25e8a5f208
commit a7e9ef170f

View File

@ -11,6 +11,24 @@ const nextConfig = {
// modern: true, // ✅ enable modern build (ES6+ for modern browsers) // modern: true, // ✅ enable modern build (ES6+ for modern browsers)
// polyfillsOptimization: true // ✅ remove unnecessary polyfills // 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; module.exports = nextConfig;