Skip to main content

What is ISR and what problem does it solve?

ISR (Incremental Static Regeneration) is a mechanism that lets you update static pages after the build, without a full application rebuild.

In short:

SSG + automatic content updates = ISR


What problem ISR solves

The problem with SSG

With classic SSG:

  • pages are generated once
  • to update content -> you need a new build
  • on a large site (1000+ pages) this is:
    • slow
    • expensive
    • inconvenient

ISR removes the dependency on a full rebuild.


How ISR works

Using Next.js as an example:

  1. The page is generated statically
  2. Users get the HTML from a CDN
  3. A set amount of time passes (revalidate)
  4. On the next request:
  • the user gets the old page
  • in the background a new version is generated
  1. The new version is cached and used going forward

No downtime. No waiting.


What makes ISR special

  • speed on par with SSG
  • data updates automatically
  • the server doesn't render the page on every request
  • cheaper than SSR

When to use ISR

  • blogs
  • product catalogs
  • marketplaces
  • courses and articles
  • pages with periodic data updates

The content changes, but not every second.


When ISR is NOT needed

  • personalized data
  • content depends on cookies / auth
  • realtime (chats, bidding)

There, SSR or CSR is better.


Example (conceptual)

ts
fetch('https://api.example.com/posts', { next: { revalidate: 60 } // revalidate once a minute })
  • 60 seconds is the acceptable "staleness" of the data
  • after that, Next.js will refresh the page automatically

ISR vs SSG vs SSR (very brief)

SSGISRSSR
HTML ready in advanceYesYesNo
Update without a buildNoYesYes
SpeedVery highVery highHigh
Server loadNoneLowHigh

Interview answer

ISR is a Next.js mechanism that lets you update static pages after the build without a full application rebuild, keeping SSG's speed and data freshness.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.