Incremental Static Regeneration in Next.js Jamstack: A Practical Guide
Learn how to refresh static pages on demand in a Next.js Jamstack site using Incremental Static Regeneration (ISR). Step‑by‑step guide, example code, deployment, verification, and monitoring tips.
16 Oct 2025, 17:53 UTC

Desired Outcome
Refresh a statically generated page on demand without triggering a full rebuild. With Incremental Static Regeneration (ISR) you can keep content fresh while still enjoying the performance and CDN benefits of static hosting.
Prerequisites
- Next.js project (v12+). Note: ISR requires
getStaticProps– pages usinggetServerSidePropsor client‑side data fetching cannot be regenerated. - Data source that can respond quickly (API, CMS, database). It should support caching or rate‑limit handling because ISR may hit it repeatedly.
- Deployment platform that supports ISR – Vercel or Netlify Edge Functions are the most common choices.
- Access to the hosting provider’s CLI or dashboard for logs and alerts.
Step‑by‑Step Procedure
- Add
getStaticPropswith arevalidatevalue.export async function getStaticProps() { const res = await fetch('https://api.example.com/posts'); const posts = await res.json(); return { props: { posts }, // Re‑generate this page at most once every 60 seconds revalidate: 60 }; }The
revalidatefield (in seconds) tells Next.js how long the cached page is considered fresh. After that period, the next request will trigger a regeneration in the background. - Deploy to a platform that supports ISR.
For Vercel, run:
vercel --prodFor Netlify, ensure the
netlify.tomlcontains theedge_functionssection or deploy via the Netlify CLI. - Verify ISR metadata in the build output.
After deployment, the build logs should contain a line similar to:
✅ ISR enabled for /blog/[slug] - Test regeneration.
1. Update the underlying data (e.g., add a new blog post via the CMS). 2. Wait at least
revalidateseconds (60 in the example). 3. Open the page in a browser, right‑click, inspect theResponse Headers, and look for a header such asx-vercel-revalidateorx-netlify-revalidatethat indicates a regeneration occurred. - Set up monitoring.
Use the provider’s dashboard to view ISR logs. For Vercel, run:
vercel logs --scope=your-project --filter=isrConfigure alerts for failed ISR events if your team relies on fresh content.
Checking the Result
- Open the page, inspect response headers for
x-vercel-revalidate(Vercel) orx-netlify-revalidate(Netlify). A value of1means a regeneration just occurred. - Verify the content reflects the updated data without a full rebuild. The build logs should show a single entry for the regenerated page with a timestamp.
- Use the hosting provider’s dashboard to confirm the ISR build succeeded. Look for status codes
200or304in the logs.
Monitoring and Recovery
- If ISR fails (e.g., due to a 5xx from the data source), the old static page will continue to be served until a successful regeneration occurs.
- Check the ISR logs for errors. In Vercel, a failed regeneration will appear with a
failedstatus. - To force a regeneration manually, use the
revalidateAPI route provided by Next.js:GET /_next/data/[build-id]/[route].json?forceRevalidate=true. This can be useful during debugging. - Adjust the
revalidateinterval if regeneration is too frequent (causing API rate‑limit issues) or too infrequent (content stale).
Limitations and Considerations
- ISR only applies to pages that use
getStaticProps. Pages withgetServerSidePropsor client‑side fetching bypass ISR entirely. - The
revalidatevalue is a minimum. If a page is visited before the interval expires, the stale cache may be served until regeneration finishes. - Large
revalidateperiods increase load on the data source because many users will hit the API at the same time when the page finally regenerates. - Edge caching (e.g., Vercel Edge Network) can reduce API calls, but you must ensure the API supports appropriate caching headers.
- Always test in a staging environment before pushing a new revalidation strategy to production.
Practical Checklist
| Task | Done? |
|---|---|
Added getStaticProps with revalidate | ✓ |
| Deployed to ISR‑capable platform | ✓ |
| Verified ISR metadata in build logs | ✓ |
| Observed regeneration header in browser | ✓ |
| Set up ISR monitoring & alerts | ✓ |
Conclusion
ISR lets you combine the speed of static pages with the freshness of dynamic data. By following the steps above, you can set up on‑demand regeneration, verify it works, and monitor for failures—all without rebuilding the entire site.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.