Keeping Data Fresh with ISR
Incremental Static Regeneration (ISR) allows you to update static content after you've built your site. You get the speed of a static site with the flexibility of a dynamic one.
How it Works
- Next.js builds your site as static HTML (Fastest possible delivery).
- You specify a `revalidate` time (e.g., 60 seconds).
- When a user visits after that time, Next.js triggers a background rebuild of just that page.
- The next visitor sees the updated content.
Example Usage
const res = await fetch('https://...', { next: { revalidate: 60 } });Your site stays blazing fast because users are never waiting for a server to process code or a database to answer a query.