Skip to main content

Command Palette

Search for a command to run...

Stop Guessing. Here's When to Use SSR, CSR, SSG and ISR in Next.js

Published
7 min read

The web is evolving fast. New frameworks are shipping optimized solutions every month to make the web faster and more secure for everyone. But with all these options comes confusion especially for beginners.

Next.js alone gives you SSR, CSR, SSG and ISR. Four different rendering strategies. Each one sounds great until you try to figure out which one your project actually needs.

I'm going to break all of them down. Not just what they are but when to use each one and how they affect your SEO because sometimes what looks like the obvious choice is actually the wrong one for your situation.

Let's get into it.

SSR: Server-Side Rendering

When a user visits a page that uses SSR the server runs your React code right at that moment. It generates the full HTML and sends it to the browser. The user sees a complete page almost instantly.

But here's the thing. That page isn't interactive yet. It looks ready but buttons don't work and forms don't respond. In the background React is "hydrating" the page which means it's attaching all the event listeners and state management to the HTML that's already on screen. Once hydration finishes everything becomes interactive.

The psychology behind this matters. Users perceive your site as fast because they see content immediately. The brief moment before hydration completes is almost never noticed.

The two metrics that matter for SSR are First Contentful Paint (how quickly the user sees something) and Time to Interactive (how quickly they can actually use it). SSR optimizes heavily for the first one.

SEO impact: SSR is great for SEO. When Google's crawler hits your page it gets fully rendered HTML with all the content right there. No waiting for JavaScript to execute. Your meta tags, headings, text content and structured data are all present in the initial response. This is why most content heavy sites that care about search rankings go with SSR.

One tradeoff to know: you don't have access to browser APIs like window or localStorage during SSR because the code runs on the server. If your component needs those you'll need to handle that with client-side checks or move that logic to a client component.

CSR: Client-Side Rendering

CSR is the traditional React approach. The browser downloads your JavaScript bundle then the V8 engine executes it and React builds the entire page on the client side.

This means two things matter more than anything: the user's device performance and their network speed.

Here's where it gets interesting. Think about who your users actually are.

If you're building a luxury helicopter rental platform for clients in New York those users almost certainly have the latest iPhones fast home internet and 5G connections. For them CSR and SSR will feel almost identical in speed. The JavaScript bundle downloads in milliseconds on their connection and their device processes it instantly.

Now imagine you're building a government services portal used by people across rural areas with older phones and slower networks. That same JavaScript bundle that loaded instantly in New York might take 5 to 8 seconds to download and another few seconds to execute on a budget Android device. Suddenly SSR isn't just a nice optimization. It's the difference between a usable site and one that people abandon.

The rendering strategy you choose should be based on who is using your product not just what the technology can do.

SEO impact: CSR is the worst option for SEO. When Google's crawler visits a CSR page it initially sees an empty div or a loading spinner. Google can execute JavaScript and eventually see your content but it's a second pass and not guaranteed. Your pages may get indexed slower or with missing content. If you don't care about SEO like an admin dashboard or internal tool then CSR is totally fine. But if you need organic traffic from search don't use CSR for those pages.

SSG: Static Site Generation

SSG generates your pages at build time. When you run next build it pre-renders every page into static HTML files. These files sit on a CDN and when someone visits they just get served instantly. No server processing. No waiting.

This is the fastest option because there's literally nothing to compute at request time. The HTML already exists.

Use SSG when the content doesn't change frequently and isn't different per user. Think marketing pages, blog posts, documentation, landing pages and about pages. Your content is the same for everyone and it only changes when you deploy.

The downside is obvious. If your data changes you need to rebuild and redeploy. For a blog with 50 posts that's fine. For an e-commerce site with 100,000 products that update prices every hour that's not practical.

SEO impact: SSG is the best option for SEO. The HTML is pre-built and sitting on a CDN so Google gets it instantly. Page speed is as fast as it gets which Google directly uses as a ranking factor. Your content is fully rendered with all meta tags and structured data baked in. If your pages don't need to change per user and you want the best possible search rankings SSG is the answer.

ISR: Incremental Static Regeneration

ISR is the hybrid approach that tries to give you the speed of SSG with the freshness of SSR.

It works like this. You statically generate the page at build time just like SSG. But you set a revalidation time. After that time passes the next visitor triggers a background regeneration of the page. They still get the cached version instantly but the next visitor after them gets the freshly regenerated page.

Think of it as SSG with an expiration date.

This is perfect for content that changes but not in real time. Product pages where prices update daily. A news site where articles are published every few hours. A dashboard that shows data that refreshes every 30 minutes. The content needs to be relatively fresh but it doesn't need to be live to the second.

SEO impact: ISR gives you almost the same SEO benefits as SSG. The page is pre-rendered so Google sees full HTML on the first crawl. And because the page regenerates in the background your content stays fresh for subsequent crawls without sacrificing speed. This is the sweet spot for sites that need both good SEO and regularly updated content. E-commerce product pages and news sites use this a lot.

So Which One Do You Actually Use?

Here's the decision framework:

Use SSG when your content rarely changes and is the same for all users. Blogs. Docs. Marketing sites. Best SEO. Fastest performance. This should be your default starting point.

Use ISR when your content changes periodically but doesn't need to be real-time. Product catalogs. News articles. Nearly as good for SEO as SSG but your data stays fresh.

Use SSR when the content is different for every user or every request. Personalized dashboards. Search results. Pages that depend on cookies or authentication. Great for SEO when you need dynamic content that search engines should still index.

Use CSR when the page is behind authentication anyway and SEO doesn't matter. Admin panels. Internal tools. Complex interactive apps where the initial load time is less important than the runtime experience.

Quick Reference

Strategy Built When SEO Speed Best For
SSG Deploy time Best Fastest Blogs docs landing pages
ISR Deploy + revalidates Great Fast Products news catalogs
SSR Every request Great Good Personalized dynamic pages
CSR In browser Poor Depends on device Admin panels internal tools

The Real Lesson

The framework gives you these options. It doesn't tell you which one to pick. That's your job as an engineer. Understanding your users their devices their networks your SEO requirements and your content update frequency is what makes the difference.

A rendering strategy isn't a technical decision. It's a product decision.

And that's the kind of thinking that no tutorial and no AI tool is going to do for you.

45 views