Overview

ISR provides the benefits of Static Site Generation (SSG) with the flexibility of Server-Side Rendering (SSR). It allows you to pre-render pages at build time but also re-generate them in the background as traffic comes in, based on a revalidation timer.

How it Works

  1. Build Time: Pages are generated as static HTML.
  2. Request: User requests a page.
  3. Revalidation: If the page is 'stale' (older than the revalidate time), the server triggers a background regeneration.
  4. Update: The next user to request the page receives the newly generated version.

Benefits

  • Fast Performance: Users still get static files from the cache.
  • Fresh Content: Content stays up-to-date without full rebuilds.
  • Scalability: Handles millions of pages without long build times.