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:
- The page is generated statically
- Users get the HTML from a CDN
- A set amount of time passes (
revalidate) - On the next request:
- the user gets the old page
- in the background a new version is generated
- 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)
| SSG | ISR | SSR | |
|---|---|---|---|
| HTML ready in advance | Yes | Yes | No |
| Update without a build | No | Yes | Yes |
| Speed | Very high | Very high | High |
| Server load | None | Low | High |
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 readyPremium
A concise answer to help you respond confidently on this topic during an interview.