Technologies
Next.js Incremental Static Regeneration
ISR is the middle ground between fully static and fully server-rendered: pages are served as static HTML, but Next.js regenerates them in the background after a set interval or an on-demand trigger, so content stays reasonably fresh without paying the cost of rendering on every single request.
This is the pattern I reach for on content that changes but not on every request — product catalogs, pricing pages, anything backed by a CMS with periodic updates.
How ISR Works
- arrow_rightA page is generated statically at build time, same as full SSG
- arrow_rightA revalidate interval defines how long the cached version is served before Next.js regenerates it in the background
- arrow_rightVisitors during regeneration still get the last valid cached version — nobody waits on a slow render
- arrow_rightOn-demand revalidation can trigger a regeneration immediately (e.g. from a CMS webhook when content is published) instead of waiting for the interval
Choosing a Revalidation Strategy
Time-based revalidation (every N seconds) is simplest and works well when a page doesn't need to reflect changes instantly. On-demand revalidation, triggered from a CMS webhook or an admin action, is worth the extra setup when publishing needs to go live immediately rather than on the next interval.
Common Mistakes
- arrow_rightSetting a revalidate interval so short it effectively behaves like SSR without the benefit of caching
- arrow_rightNot setting up on-demand revalidation for content editors who expect changes to appear immediately after publishing
- arrow_rightAssuming ISR updates every visitor instantly — the first visitor after expiry still sees the stale version while regeneration happens in the background
Frequently Asked Questions
Does ISR work for pages that don't exist yet at build time?add
Yes — Next.js supports generating new static pages on-demand the first time they're requested (for paths not included in generateStaticParams), then caching them for subsequent visitors according to the revalidation strategy.
How is ISR different from SSR?add
SSR renders on every request. ISR renders once, serves the cached result to everyone, and only re-renders in the background after the cache expires — far less server load for content that doesn't need to be second-by-second fresh.
Can I trigger revalidation from my CMS?add
Yes — most headless CMS platforms support webhooks, which can call an on-demand revalidation API route in Next.js the moment content is published, so pages update immediately instead of waiting for the timed interval.