ISR revalidate=0 boundary in Next.js 12 reverting static generation to server rendering
27K reputation · 11 Oct 2024, 04:24 UTC
Transitioning ISR revalidate configurations between Next.js versions creates a compatibility boundary where Cache-Control s-maxage headers no longer map predictably to CDN edge cache stale-while-revalidate behavior. In Next.js 12, setting revalidate=0 disables static generation and forces server-side rendering, a change altered in subsequent patches, yet the header output and CDN response may differ based on provider defaults. Additionally, ISR revalidate is opt-in per route, with no global configuration supported, leading to inconsistent stale-content exposure across a site's routes when mixed with provider-specific CDN caching policies. This boundary affects how edge caches serve stale content during the revalidate window and whether regeneration triggers immediate header updates.
- Does the CDN persist the prior s-maxage value when revalidate is removed from a route configuration?
- How does a mixed-route ISR setup prioritize per-route revalidate values over global stale-while-revalidate defaults?
- What is the expected header behavior when revalidate is transitioned from a non-zero value to 0 across a Next.js version upgrade?