Course contentsShow
← React
Lesson 1678 of 2,39640. Server-Side RenderingFree lesson

Incremental Static Regeneration (ISR): Hybrid Freshness

Combining SSG's speed with periodic rebuilds or on-demand revalidation for stale-while-revalidate patterns.

Incremental Static Regeneration (ISR): Hybrid Freshness

What you'll learn: How ISR combines the blazing speed of static generation with the ability to update content without full rebuilds.

The Best of Both Worlds

Remember SSG's limitation? Pages are fast but stale until the next build. ISR solves this by letting you regenerate individual pages in the background after they're deployed. Think of it like a restaurant that pre-cooks popular dishes (SSG) but can refresh specific items on the fly when ingredients change, without closing the kitchen for a complete restock.

How ISR Works

With ISR, you set a revalidation interval on statically generated pages. When someone requests a page after that interval expires:

  1. Stale content is served immediately (the old static version)
  2. Regeneration happens in the background (new data is fetched)
  3. The cache updates for the next visitor

This is the stale-while-revalidate pattern: users never wait for fresh data, but the page gradually updates itself.

Two Flavors

Time-based revalidation: "Regenerate this page every 60 seconds if someone visits it."

On-demand revalidation: "Regenerate this specific page right now" (triggered by webhooks, CMS updates, or Server Actions via revalidatePath/revalidateTag).

The ISR Sweet Spot

ISR shines for:

  • E-commerce product pages (prices change occasionally)
  • Blog posts (comments added, corrections made)
  • Content that's mostly stable but occasionally updates
  • High-traffic pages where SSR would be too expensive

You get near-instant page loads AND eventual freshness without constant server rendering.

Key Takeaway: ISR bridges SSG's speed and SSR's freshness by serving stale static content instantly while regenerating pages in the background—giving you fast, eventually-fresh pages without sacrificing performance or requiring full rebuilds.