03 / 20

What is Incremental Static Regeneration (ISR)?

Difficulty: 6/10
incremental static regeneration, revalidation, on-demand ISR

ISR enables you to use static generation on a per-page basis while revalidating pages in the background as traffic comes in. Incremental Static Regeneration (ISR) enables you to:

  1. 1

    Update static content without rebuilding the entire site

  2. 2

    Reduce server load by serving prerendered, static pages for most requests

  3. 3

    Ensure proper cache-control headers are automatically added to pages

  4. 4

    Handle large amounts of content pages without long next build times

javascript
Here's how this example works:
  1. 1

    During next build, all known blog posts are generated (there are 25 in this example)

  2. 2

    All requests made to these pages (e.g. /blog/1) are cached and instantaneous

  3. 3

    After 60 seconds has passed, the next request will still show the cached (stale) page

  4. 4

    The cache is invalidated and a new version of the page begins generating in the background

  5. 5

    Once generated successfully, Next.js will display and cache the updated page

  6. 6

    If /blog/26 is requested, Next.js will generate and cache this page on-demand

Scenario Questions

0-2 years experience

  1. 1How would you configure a Next.js page to use ISR with a revalidation time of 10 seconds?
  2. 2What does a user see when they request a page that is currently being regenerated by ISR?
  3. 3If you forget to export getStaticProps on a page you intended to use ISR, what will happen at runtime?

2-5 years experience

  1. 1Your product listing page uses ISR with revalidate: 60, but after a promotion ends users still see the old price. How would you investigate and fix it?
  2. 2Explain the trade‑offs between ISR and server‑side rendering for a dashboard that needs to refresh data every minute.
  3. 3After a recent deployment, ISR pages are no longer updating when the underlying content changes. What could be causing this behavior?

5-8 years experience

  1. 1Design a strategy that combines ISR with on‑demand revalidation so authors can publish blog updates instantly without a full redeploy.
  2. 2What performance impacts might you see if you set a very low revalidate interval on a page that calls an external API with strict rate limits?
  3. 3How would you set up monitoring and alerting to detect ISR regeneration failures in a large Next.js monorepo?

8+ years experience

  1. 1Your team is migrating a legacy e‑commerce platform to Next.js. How would you decide which pages get ISR, which stay SSR, and plan a phased rollout?
  2. 2Discuss cross‑team considerations when exposing an on‑demand ISR endpoint for content editors, including security, authentication, and rate‑limiting.
  3. 3At global scale, how would you architect the CDN and caching layers to ensure ISR works consistently across multiple regions and edge nodes?

Follow-up Questions

  • What steps would you take to debug a page that is serving stale ISR content?
  • Which metrics would you monitor to know ISR is working correctly at scale?
  • How would you handle a situation where the external data source fails during regeneration?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.