Using Vercel’s Incremental Static Regeneration to Keep Next.js Pages Fresh Without Full Rebuilds
Learn how to use Vercel’s Incremental Static Regeneration to keep Next.js pages fresh after deployment without rebuilding the whole site.
04 Aug 2025, 18:19 UTC

Problem: stale static pages after deployment
When you deploy a Next.js site to Vercel, pages generated with getStaticProps are frozen at build time. If the underlying data changes, users see outdated content until you trigger a new build.
Thesis: ISR lets you set a revalidation interval so Vercel refreshes the page in the background
By adding a revalidate value to the object returned from getStaticProps, Vercel’s edge network will automatically regenerate the page after the interval expires, serving the fresh version to the next visitor.
How to enable ISR in a Next.js page
- Ensure you are using Next.js ≥12.1.
- Export
getStaticPropsand return arevalidatefield (seconds). - Deploy to Vercel as usual; no extra configuration is needed.
export async function getStaticProps() {
const res = await fetch('https://example.com/api/posts');
const posts = await res.json();
return { props: { posts }, revalidate: 60 };
}
What happens under the hood
- First request after the interval triggers a background regeneration.
- Visitor sees the cached version while the new page builds.
- Once ready, Vercel updates the edge cache; subsequent requests get the fresh content.
Trade‑off: freshness vs. edge‑cache churn and cost
A shorter revalidate interval means fresher data but more frequent regeneration requests. If your external API has rate limits, a very low interval (e.g., 5 seconds) could cause throttling or extra usage on Vercel’s platform. Conversely, a long interval (e.g., 3600 seconds) reduces load but may serve stale content for longer.
How to verify ISR is working
- Deploy the app to Vercel and note the URL.
- Open the page; check response headers for
x-vercel-cache: HIT. - Wait longer than the
revalidatevalue (e.g., 70 s for a 60‑s interval). - Refresh; the first request may show
x-vercel-cache: MISSas Vercel regenerates, followed byHITon later reloads. - In Vercel Analytics, look for an increase in cache miss/revalidation events after the interval.
Limitations
- ISR only works for pages that are statically exportable; you cannot use it with
getServerSidePropsor custom API routes that need per‑request server logic. - If the data changes more often than the interval, stale content appears between regenerations.
- Excessively short intervals can hit Vercel’s edge‑request rate limits and increase cost; monitor usage in the Vercel dashboard.
Choose a revalidation interval that matches your data’s update frequency and your API’s capacity to keep pages up‑to‑date without a full site rebuild.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.