Incremental Static Regeneration (ISR)
Static pages that update in the background - best of both worlds
How ISR Works
1. Static First
Pages are pre-rendered at build time for instant loading
2. Background Updates
Content revalidates in background after specified time
3. Seamless Refresh
Users get fresh content without waiting for builds
sunt aut facere repellat provident occaecati excepturi optio reprehenderit
quia et suscipit suscipit recusandae consequuntur expedita et cum reprehenderit molestiae ut ut quas totam nostrum rerum est autem sunt rem eveniet architecto
qui est esse
est rerum tempore vitae sequi sint nihil reprehenderit dolor beatae ea dolores neque fugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis qui aperiam non debitis possimus qui neque nisi nulla
ea molestias quasi exercitationem repellat qui ipsa sit aut
et iusto sed quo iure voluptatem occaecati omnis eligendi aut ad voluptatem doloribus vel accusantium quis pariatur molestiae porro eius odio et labore et velit aut
Technical Details
Time-based (60 seconds)
stale-revalidating
10/1/2025, 6:55:15 PM
JSONPlaceholder API
ISR Benefits
- Fast initial page loads (static generation)
- Fresh content without full rebuilds
- Automatic fallback to cached content during API failures
- Reduced server load with intelligent caching
πTechnical Deep Dive: How ISR Works
ISR Revalidation Lifecycle
ISR Configuration Code
Page-level Revalidation:
// page.tsx export const revalidate = 60; export default async function Page() { const data = await fetch(url, { next: { revalidate: 60 } }); return <div>{/* content */}</div>; }
Fetch-level Revalidation:
// Individual fetch control const posts = await fetch(url, { next: { revalidate: 60, // 60 seconds tags: ['posts'] // Cache tags } }); // On-demand revalidation revalidateTag('posts');
Current Cache State Visualization
ISR vs Other Strategies
Strategy | Initial Load | Data Freshness | Server Load | Build Time |
---|---|---|---|---|
SSG | β‘ Instant | β Build-time only | β Minimal | β οΈ Can be long |
SSR | β‘ Fast | β Always fresh | β High | β Quick |
ISR | β‘ Instant | β Configurable | β Low | β Quick |
CSR | β Slow | β Real-time | β Minimal | β Quick |
ISR Use Cases & Examples
Perfect for:
- E-commerce product pages
Price/inventory updates without rebuilds - Blog posts with comments
Static content with periodic updates - News articles
Breaking news updates without full rebuilds
Configuration Examples:
revalidate: 3600
1 hour - reduce server load
revalidate: 60
1 minute - frequent updates
revalidate: 10
10 seconds - breaking news