DEV Community

Cover image for Next.js ~Uncremental Static Regeneration(ISR)~
Ogasawara Kakeru
Ogasawara Kakeru

Posted on

Next.js ~Uncremental Static Regeneration(ISR)~

Basic system

In the route that has a static parameter(e.g /blog/[slug]), only URL that is aligned in the generateStaticParams is prerendered.

If there is an access that is not aligned in URL, App Shell is returned immediately. App Shell is the static shell that uses Suspense fallbacks for the parameter-dependent parts.

It is then upgrated to a specific page that has the parameter in the background, cached, and served to next visitor.

ISR is an extension of the Partial Prerendering (PPR) concept that runs on top of Cache Components (cacheComponents: true in next.config.ts). Static shells can be served directly from the CDN, resulting in faster direct access.

The timing of regenerated HTML is controled by revalidate and expire of cachelife.
The cache is only valid within a singlr deployment. In new deployment, the entry of use cache isn't carried over because the cache key include the build ID.

Top comments (0)