ISR lets a statically generated page be revalidated after a time window or on demand. It is a strong fit for product listings, blog posts and marketing pages that can tolerate a short delay; it is a poor fit for a personalised dashboard.
Key takeaways
- Target: Serve static pages quickly while refreshing content on a known schedule or event.
- Measure field data before choosing a fix.
- Change one bottleneck at a time and re-measure on a mid-range phone.
- A fast lab score is not a substitute for real-user data.
What Incremental Static Regeneration measures
Check the build output, the response headers and the time between an edit and the public page update. Test the first request after the revalidation window and the on-demand invalidation path.
The fixes that usually move the number
- Set a
revalidatewindow that matches how often the content changes. - Use
revalidatePathorrevalidateTagafter an editor publishes. - Keep personalised fragments client-side or behind a dynamic route.
- Warm important pages after a deploy if the first request is slow.
- Monitor stale content and failed revalidation jobs.
Symptom, cause and fix
| Symptom | Likely cause | What to do |
|---|---|---|
| Edit takes an hour to appear | Time-based ISR only | Add on-demand revalidation on publish |
| Page shows one user's data | Personalised content in a static page | Move it to a dynamic fragment |
| First request after deploy is slow | Cold cache | Warm key routes or use a background job |
| Build takes too long | Too many static pages | Generate the important routes and fall back for the long tail |
How to measure it properly
- Inspect the route. Confirm it is static or ISR, not dynamic on every request.
- Change content. Measure the delay before the public page updates.
- Test on-demand revalidation. Publish and confirm the webhook or action fires.
- Check errors. Monitor revalidation failures and stale cache warnings.
- Review personalisation. Log in and confirm no private data is cached.
A practical example
// app/blog/[slug]/page.tsx
export const revalidate = 3600;
export async function generateStaticParams() {
return getPublishedSlugs();
}
Common mistakes
- Using ISR for prices or stock that must be exact.
- Forgetting to invalidate after a CMS publish.
- Caching a page that includes a session-specific banner.
- Setting a long revalidate window without a manual refresh path.
A 30-day improvement plan
- Week 1. Collect field data and pick the worst route. Write down the baseline.
- Week 2. Fix the largest bottleneck and deploy behind a normal release.
- Week 3. Test on a mid-range phone and a throttled connection; fix regressions.
- Week 4. Compare field data, document the change and add a monitor or budget.
Field data vs lab data
| Source | What it tells you | How to use it |
|---|---|---|
| Field data | What real users experienced | The source of truth for the metric |
| Lab test | A reproducible diagnosis | Find the cause and test a fix |
| Synthetic monitoring | Availability and regressions over time | Alert on a budget breach |
| RUM segmentation | Device, country and route differences | Target the worst segment |
| Server timing | Database, cache and render time | Separate backend from frontend |
Set a performance budget
| Budget | Example starting point | Why |
|---|---|---|
| LCP | 2.5s or less at p75 | The main content must appear quickly |
| INP | 200ms or less at p75 | Interactions must feel responsive |
| CLS | 0.1 or less at p75 | Layout movement erodes trust |
| JavaScript | A route-level KB budget | Prevents bundle creep |
| Images | Responsive sizes and modern formats | The largest common payload |
| Third-party scripts | A named owner and a cap | Uncontrolled tags are a common regression |
Third-party script policy
- Every script needs an owner, a purpose and a review date.
- Load analytics and marketing tags after consent and after the main content.
- Prefer server-side events where they reduce client JavaScript.
- Test the checkout and sign-up with the full tag set enabled.
- Remove tags that no longer answer a business question.
Frequently asked questions
The target is Serve static pages quickly while refreshing content on a known schedule or event. A single fast test is not enough; use the 75th percentile of real page views and segment by mobile and desktop.
No. Start with the routes that matter to revenue or support: checkout, pricing, sign-up, the main product page and the most-read blog template. A fast homepage with a slow checkout is not a fast site.
It depends on traffic. Low-traffic sites can take weeks to accumulate enough data. Use lab tools for immediate feedback, but keep the field metric as the source of truth.
Often yes. Image dimensions, priority, bundle splits, caching and third-party scripts usually deliver more than a visual refresh. Redesign only after the measurement shows the layout itself is the bottleneck.
Sources and further reading
- Next.js incremental static regeneration (nextjs.org)
- Next.js caching and revalidation (nextjs.org)
- Next.js self-hosting guide (nextjs.org)
Related reading
Need a performance audit?
Send the URL and the metric that matters. I will identify the bottleneck, the likely fix and the cheapest way to prove it worked.
How to cite this guide: Nur Hossain Repon, “ISR optimization guide for Next.js and React apps”, Nhrepon Portfolio, reviewed October 2026, https://nhrepon.com/posts/isr-optimization-guide-for-next-js-and-react-apps.





Comments
No comments yet.