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:
2025-09-10 11:46:52 +02:00
parent 0bcba1643e
commit 8ea4fc3fd3

View File

@@ -41,6 +41,24 @@ const nextConfig: NextConfig = {
formats: ['image/webp', 'image/avif'],
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";