
ISR in Next.js: The Perfect SEO & Performance Strategy

Table Of Contents
Once, I was working on a project—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 stumbled upon Incremental Static Regeneration (ISR) in Next.js—a game-changing solution. 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 (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 Is ISR a Game-Changer for SEO & 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 love fast, fresh content. ISR ensures Google always finds updated pages.
- 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)
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
Ready to take your Next.js blog to the next level? Implement ISR today and watch your SEO and performance skyrocket. You can also contact me at any time with questions or suggestions.
Frequently Asked Questions
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.
Can I use ISR with API routes?
Yes! Just add the next: { revalidate: 3600 } option when fetching data inside getServerSideProps or API calls.
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.