Next.js Discord

Discord Forum

404 page includes same ISR cache headers

Unanswered
Chausie posted this in #help-forum
Open in Discord
ChausieOP
I'm using cloudflare as a CDN for my self hosted app, which uses the cache-control headers from the app, I've included these in the page file

export const revalidate = 3600;
export const dynamic = "force-static";


but if I return a notFound() in that page, it returns a 404 page with the exact same cache-control headers, so the CDN will cache that too? the 404 page should return no cache headers?

am I missing something to make sure 404 pages return the correct cache control headers?

0 Replies