From 8ea4fc3fd35d601477244672422beae5fe25b112 Mon Sep 17 00:00:00 2001 From: denshooter Date: Wed, 10 Sep 2025 11:46:52 +0200 Subject: [PATCH] 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 --- next.config.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/next.config.ts b/next.config.ts index 46b54f4..2c05905 100644 --- a/next.config.ts +++ b/next.config.ts @@ -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";