diff --git a/next.config.mjs b/next.config.mjs index ec42522..66db4d1 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -49,6 +49,23 @@ const nextConfig = { { key: 'Cache-Control', value: 'public, max-age=86400, stale-while-revalidate=604800' }, ], }, + { + // Homepage and news routes must never be cached at edge — the hero + // and feed are DB-driven via force-dynamic, but Next.js sets a + // long s-maxage on prerendered HTML which CF then caches for a year. + source: '/', + headers: [ + { key: 'Cache-Control', value: 'no-store, must-revalidate' }, + { key: 'CDN-Cache-Control', value: 'no-store' }, + ], + }, + { + source: '/news/:path*', + headers: [ + { key: 'Cache-Control', value: 'no-store, must-revalidate' }, + { key: 'CDN-Cache-Control', value: 'no-store' }, + ], + }, ]; },