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
- Build Time: Pages are generated as static HTML.
- Request: User requests a page.
- Revalidation: If the page is 'stale' (older than the revalidate time), the server triggers a background regeneration.
- 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.