Skip to content

ISR (Incremental Static Regeneration)

A technique combining the efficiency of static pages with the ability to update them automatically without a complete rebuild of the application.

Definition

ISR (Incremental Static Regeneration) is a technique available in Next.js that combines the advantages of SSG (speed of static pages) with the flexibility of SSR (fresh data). Pages are generated statically and served from cache, but can automatically rebuild after changes.

Two ways ISR works:

  • Time-based - the page rebuilds every X seconds (e.g., revalidate: 3600 = every hour)
  • On-demand - the page rebuilds on demand, e.g., after a webhook from the CMS

Example of on-demand revalidation with cache tags:

// Fetching posts with the "posts" tag
fetchStrapi("/posts", { tags: ["posts"] });

// Webhook from CMS → rebuild only changed pages
revalidateTag("posts");

Comparison with other approaches:

  • SSG without ISR - 200 posts in 2 languages = 400 pages to rebuild with each change. ISR only rebuilds the one page that has changed
  • SSR - page regenerated with each request. Slower than ISR, where the page is cached until it changes
  • CSR - browser builds the page with JavaScript. Worse SEO, slower loading

When ISR works best:

  • Blog with headless CMS - publish in Strapi/Contentful → page updated in seconds
  • E-commerce store - prices and availability are updated without rebuilding
  • Page with a large number of subpages - you don’t have to rebuild 10,000 pages to change one

Why it might matter to you?

ISR solves a problem that kills content creators’ productivity: “I have to deploy to fix a typo.” If you’re building a blog with a headless CMS (Strapi, Contentful, Sanity), ISR lets you click “Publish” in the CMS panel and the page automatically refreshes its content. No deployments, no waiting for builds.

  1. SSG (Static Site Generation)

    Generating HTML pages at application build time, ready-made files are served from a CDN instantly without any server-side processing.
  2. SEO

    Optimizing your site so it ranks in Google for queries your target audience searches, the cheapest long-term traffic channel for indie products.
  1. Build in Public6 minHow I created a blog in Next.js (stack, CMS, hosting, SEO)How did I build a blog about marketing for developers? Next.js with ISR, Strapi on Railway, Cloudflare R2, PostHog, Sentry, and MailerLite - the entire tech stack, decisions, and Lighthouse results.