Fix caching issues - disable static generation and add cache-busting headers
- Disable generateStaticParams to prevent static generation - Add Cache-Control headers to force revalidation - This should fix the issue where new routes are not available after deployment
This commit is contained in:
@@ -41,6 +41,24 @@ const nextConfig: NextConfig = {
|
|||||||
formats: ['image/webp', 'image/avif'],
|
formats: ['image/webp', 'image/avif'],
|
||||||
minimumCacheTTL: 60,
|
minimumCacheTTL: 60,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Disable static generation for dynamic routes
|
||||||
|
generateStaticParams: false,
|
||||||
|
|
||||||
|
// Add cache-busting headers
|
||||||
|
async headers() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
source: '/(.*)',
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
key: 'Cache-Control',
|
||||||
|
value: 'public, max-age=0, must-revalidate',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
import bundleAnalyzer from "@next/bundle-analyzer";
|
import bundleAnalyzer from "@next/bundle-analyzer";
|
||||||
|
|||||||
Reference in New Issue
Block a user