Suggest an editImprove this articleRefine the answer for “What is ISR in Next.js?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**ISR (Incremental Static Regeneration)** in **Next.js** is a hybrid of **SSG + background update**, where a page stays **static and fast**, but is **periodically rebuilt** without a full rebuild of the site. **Key point:** the user **never waits** for the rebuild.Shown above the full answer for quick recall.Answer (EN)Image**ISR (Incremental Static Regeneration)** in **Next.js** is a hybrid of **SSG + background update**, where a page stays **static and fast**, but is **periodically rebuilt** without a full rebuild of the site. ## How ISR works 1. On `next build` the page is **generated once** (like SSG) 2. Users get **static HTML** 3. `revalidate` seconds pass 4. **Next request**: - the old HTML is served right away - the new one is rebuilt **in the background** 5. Subsequent users will see the updated version ``` build → static HTML → users ↓ (revalidate) background rebuild ``` A user **never waits** for the rebuild. --- ## How to enable ISR (App Router) ### Via `revalidate` ```ts // app/blog/page.tsx export const revalidate = 60; // seconds export default async function Page() { const posts = await getPosts(); return <Posts posts={posts} />; } ``` ### Via `fetch` ```ts await fetch("https://api.example.com/posts", { next: { revalidate: 60 }, }); ``` --- ## When to use ISR ISR is a great fit when: - the content is **public** - the data **gets updated** - **SEO** is needed - **speed** matters Typical cases: - a blog - a product catalog - roadmaps - articles - marketing pages with updates --- ## Pros of ISR - almost as fast as SSG - data updates automatically - no load like with SSR - no full rebuild needed - great for a CDN --- ## Cons of ISR - data is not always "right now" - a stale version is possible until revalidate - not suited for personalization - cannot be used for auth data --- ## ISR vs SSG vs SSR | | SSG | ISR | SSR | | --- | --- | --- | --- | | Speed | high | high | medium | | Freshness | no | partial | yes | | Server | no | partial | yes | | SEO | yes | yes | yes |For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.