Article · Tutorial · Next.js Tutorials · Frontend Development · SEO for Developers
ISR in Next.js: The Perfect SEO & Performance Strategy

ISR in Next.js came out of a project I was working on once — a dynamic blog where content was king. It had great design, engaging posts, and an audience hungry for fresh updates. But something wasn’t right.
I noticed that new blog posts weren’t appearing immediately. Readers kept seeing outdated articles, and search engines weren’t quickly picking up my latest posts. I knew I had to fix this. SEO and performance were at stake. That’s when I found Incremental Static Regeneration (ISR) in Next.js. I thought, What if my site could stay as fast as a static website but still update automatically? So, I decided to try it.
What Is ISR in Next.js (Incremental Static Regeneration)?
ISR is the best of both worlds—it combines SSG (Static Site Generation) and SSR (Server-Side Rendering) to create dynamic static pages.
Here’s how it works:
- Pre-rendering at build time: The blog archive is generated statically.
- Cached content served: Visitors get the cached version if it's fresh.
- Background regeneration: Once the cache expires (after 1 hour), Next.js fetches new posts without rebuilding the whole site.
- Automatic updates: The next visitor sees fresh content instantly.
How to Implement ISR for Your Blog Archive
Add revalidate at the Top of Your Page. Ex. blog/page.tsx or similar
export const revalidate = 3600; // Regenerates every 1 hour
To enable ISR, add the following code to your API fetch function: API Fetch with ISR (utils/fetch.ts)
export const getPosts = async () => {
const URL = `${process.env.NEXT_PUBLIC_URL}/api/v1/open/posts`;
const response = await fetch(URL, {
method: "GET",
headers: { "Content-Type": "application/json" },
next: { revalidate: 3600 }, // Enable ISR for API calls
});
if (!response.ok) {
throw new Error("Failed to fetch posts");
}
return await response.json();
};
How This Works:
- SSG (Static Site Generation) pre-renders the archive page at build time.
- If a request comes within 1 hour, Next.js serves the cached version (super fast ⚡).
- After 1 hour, Next.js fetches fresh posts in the background.
- The next visitor automatically gets the latest blog archive.
Why ISR helps both SEO and performance
ISR is one of the most potent techniques in Next.js for highly dynamic websites. Here’s why:
- Super Fast Page Load Times – Pre-rendered pages load instantly, improving user experience.
- SEO Boost – Search engines reward fast, fresh content. ISR keeps the pages Google crawls up to date.
- Automatic Updates – New blog posts appear automatically, no need to redeploy the site.
- Works on Any Page – Use ISR for blog archives, category pages, tag pages, and more.
You Can Also Apply This To:
- /category/[categorySlug]/page.tsx (Category pages)
- /tag/[tagSlug]/page.tsx (Tag pages)
- /blog/page.tsx (Blog archive)
Where ISR is the wrong choice
It is not free, and it is not for everything. A page behind a login should not be cached at all. A page whose content must be correct to the second — a stock level, a live price — should not be either, because ISR's whole bargain is that somebody sees a slightly stale page so everybody gets a fast one.
Pick the revalidate window by asking how stale is acceptable, not how fresh is possible. Most blogs can live with an hour. When a client asks me for a minute, I ask what the page shows first, and together we pick the window that fits.
One more thing to plan for: the first visitor after the window expires still gets the stale page. Regeneration happens behind them. That is usually fine, and it surprises people when it is not.
Future-Proof Your Blog with ISR
If you want lightning-fast pages, automatic updates, and better SEO rankings, implement ISR in Next.js. This will ensure that your blog, category, and tag pages stay fresh without the hassle of redeployment.
- No more slow SSR requests
- No more outdated static pages
- No more manual rebuilds
If your blog is static today and stale by Friday, ISR is the smallest change that fixes it. You can also contact me at any time with questions or suggestions.
Questions
Questions this post answers
What happens if a visitor comes during revalidation?
- The old cached page is served while Next.js fetches fresh data in the background. The next visitor gets the updated page.
How do I use ISR when fetching data?
- In the App Router, add next: { revalidate: 3600 } to a fetch call, or export revalidate from the page or layout. In the Pages Router, return revalidate from getStaticProps. getServerSideProps runs on every request, so ISR does not apply there.
Is ISR better than SSR?
- For SEO and performance, ISR is better than SSR because it caches pages and serves them instantly. SSR regenerates on every request, slowing down response time.