Next.js provides multiple rendering techniques to balance performance, SEO, scalability, and user experience. Understanding when and how each rendering strategy works is critical for building production-ready applications.
This guide explains CSR, SSR, SSG, ISR, and PPR with clear explanations, examples, use cases, and interview questions.
 What Is Rendering in Next.js?
Rendering is the process of converting React components into HTML that the browser can display. Next.js supports multiple rendering strategies instead of forcing a single approach.
 1. Client-Side Rendering (CSR)
 What Is CSR?
In Client-Side Rendering, the browser downloads a minimal HTML page and then renders content using JavaScript on the client.
 How CSR Works
- Browser loads HTML shell Â
- JavaScript bundle downloads Â
- React renders UI in the browser Â
- Data fetching happens on the client
 Example (CSR)
“`tsx
“use client”;
import { useEffect, useState } from “react”;
Â
export default function Page() {
  const [data, setData] = useState(null);
  useEffect(() => {
    fetch(“/api/posts”)
      .then(res => res.json())
      .then(setData);
  }, []);
  return <div>{data ? data.title : “Loading…”}</div>;
}
“`
 Advantages
– Fast navigation after load Â
– Rich interactivity Â
– Simple data fetching
 Disadvantages
– Poor SEO (initially empty HTML)Â Â
– Slower first load Â
– Depends heavily on JavaScript
 Use Cases
– Dashboards Â
– Authenticated apps Â
– Admin panels
 2. Server-Side Rendering (SSR)
 What Is SSR?
In Server-Side Rendering, HTML is generated on the server for every request.
 How SSR Works
- Request sent to server Â
- Server fetches data Â
- HTML generated Â
- Sent to browser Â
- React hydrates the page
 Example (SSR)
“`tsx
export default async function Page() {
  const res = await fetch(“https://api.example.com/posts”, { cache: “no-store” });
  const data = await res.json();
  return <div>{data.title}</div>;
}
“`
 Advantages
– Excellent SEOÂ Â
– Always fresh data Â
– Fast First Contentful Paint
 Disadvantages
– Slower TTFBÂ Â
– Higher server load Â
– Not cached by default
 Use Cases
– User-specific pages Â
– Real-time dashboards Â
– Dynamic content
 3. Static Site Generation (SSG)
 What Is SSG?
In Static Site Generation, pages are rendered at build time and served as static HTML.
 How SSG Works
- Build runs Â
- Pages generated as HTMLÂ Â
- Deployed to CDNÂ Â
- Served instantly
 Example (SSG)
“`tsx
export default async function Page() {
  const res = await fetch(“https://api.example.com/posts”);
  const data = await res.json();
Â
  return <div>{data.title}</div>;
}
“`
Â
 Advantages
Â
– Fastest performance Â
– Great SEOÂ Â
– Minimal server cost
Â
 Disadvantages
Â
– Data can become stale Â
– Rebuild required for updates
Â
 Use Cases
Â
– Blogs Â
– Marketing pages Â
– Documentation sites
Â
 4. Incremental Static Regeneration (ISR)
Â
 What Is ISR?
Â
ISR allows static pages to be updated after deployment without rebuilding the entire site.
Â
 How ISR Works
Â
- Page served from cache Â
- After `revalidate` time, Next.js regenerates page Â
- New page replaces old one
Â
 Example (ISR)
Â
“`tsx
export default async function Page() {
  const res = await fetch(“https://api.example.com/posts”, {
    next: { revalidate: 60 }
  });
  const data = await res.json();
  return <div>{data.title}</div>;
}
“`
 Advantages
– Combines SSG + SSR benefits Â
– Scalable Â
– SEO friendly
 Disadvantages
– Slightly stale data possible Â
– More complex caching logic
 Use Cases
– Product listings Â
– News websites Â
– E-commerce catalogs
 5. Partial Prerendering (PPR)
Â
 What Is PPR?
Â
Partial Prerendering (PPR) allows parts of a page to be static while other parts are dynamic, streamed at runtime.
> Introduced in modern Next.js App Router for optimal performance.
 How PPR Works
– Static shell rendered at build time Â
– Dynamic sections fetched on request Â
– Page streams progressively
 Example (PPR)
Â
“`
tsx
import { Suspense } from “react”;
function DynamicContent() {
  return <div>Live Data</div>;
}
export default function Page() {
  return (
    <>
      <h1>Static Header</h1>
      <Suspense fallback={<p>Loading…</p>}>
        <DynamicContent />
      </Suspense>
    </>
  );
}
“`
 Advantages
– Best performance Â
– Fine-grained control Â
– Excellent UX
 Use Cases
– Dashboards Â
– Personalized content Â
– Mixed static + dynamic pages
 Rendering Strategy Comparison
Â
Technique | Render Time | SEO | Performance | Use Case |
|---|---|---|---|---|
CSR | Client | Poor | Medium | Dashboards |
SSR | Request time | Excellent | Medium | Dynamic pages |
SSG | Build time | Excellent | Fastest | Blogs |
ISR | Build + runtime | Excellent | Fast | Large sites |
PPR | Mixed | Excellent | Best | Hybrid apps |
 Rendering Flow Diagrams (ASCII)
Â
 Client-Side Rendering (CSR)
“`
User Request
     ▼
HTML Shell
     ▼
JS Bundle Download
     ▼
React Renders UI in Browser
     ▼
Content Visible & Interactive
“`
 Server-Side Rendering (SSR)
“`
User Request
     ▼
Server Fetches Data
     ▼
HTML Generated on Server
     ▼
Browser Receives HTML
     ▼
Hydration (JS attaches events)
“`
Static Site Generation (SSG)
“`
Build Time
   ▼
HTML Generated
   ▼
Stored on CDN
   ▼
User Request → Instant Response
“`
Incremental Static Regeneration (ISR)
“`
User Request
   ▼
Serve Cached Page
   ▼
Revalidate in Background
   ▼
New Page Generated
“`
Partial Prerendering (PPR)
“`
Build Time
   ▼
Static Shell Rendered
   ▼
User Request
   ▼
Dynamic Parts Streamed
“`
Conclusion
Each rendering technique serves a different purpose, and the right choice depends on the application’s requirements. CSR is suitable for highly interactive applications like dashboards but suffers from poor SEO. SSR improves SEO and initial load time, making it ideal for dynamic, content-driven pages. SSG offers the best performance and SEO by generating pages at build time, making it perfect for blogs and static content. ISR combines the benefits of SSG and SSR by enabling incremental updates, which works well for large-scale websites. PPR provides the most flexibility by mixing static and dynamic rendering, making it an excellent choice for modern hybrid applications.
In practice, modern web applications often use a hybrid approach, selecting different rendering strategies for different pages to balance performance, scalability, and SEO effectively.
