DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
  1. Home
  2. Articles
  3. Frontend Engineering
  4. SSR vs CSR vs SSG vs ISR: Rendering Strategies Explained
XLinkedInReddit
MediumFrontend Engineering

SSR vs CSR vs SSG vs ISR: Rendering Strategies Explained

D
DevPrep Team
February 10, 2026·2 min read·0
Table of Contents
  • Client-Side Rendering (CSR)
  • Server-Side Rendering (SSR)
  • Static Site Generation (SSG)
  • Incremental Static Regeneration (ISR)
  • Decision Matrix

Choosing the right rendering strategy is one of the most impactful architectural decisions. Here's when to use each.

Client-Side Rendering (CSR)

The browser downloads a minimal HTML shell, then JavaScript renders everything.

<!-- Initial HTML -->
<div id="root"></div>
<script src="/bundle.js"></script>
// JavaScript fetches data and renders UI

Pros: Rich interactivity, simpler deployment, good for authenticated apps
Cons: Slow initial load, poor SEO (without prerendering), blank screen until JS loads

Server-Side Rendering (SSR)

Server renders full HTML on each request. Client hydrates for interactivity.

// Server generates complete HTML
app.get("/products/:id", async (req, res) => {
  const product = await db.getProduct(req.params.id);
  const html = renderToString(<ProductPage product={product} />);
  res.send(wrapInShell(html));
});

Pros: Fast FCP, great SEO, dynamic content
Cons: Server load per request, TTFB depends on data fetching speed, hydration cost

Static Site Generation (SSG)

Pages pre-rendered at build time. Served as static HTML from CDN.

// Build time: generate all product pages
export async function getStaticPaths() {
  const products = await db.getAllProducts();
  return products.map(p => ({ params: { id: p.id } }));
}

export async function getStaticProps({ params }) {
  const product = await db.getProduct(params.id);
  return { props: { product } };
}

Pros: Fastest possible (CDN-served), cheapest (no server), perfect SEO
Cons: Build time grows with pages, stale data until rebuild

Incremental Static Regeneration (ISR)

SSG + background revalidation. Serves stale page while regenerating in the background.

export async function getStaticProps() {
  const data = await fetchData();
  return {
    props: { data },
    revalidate: 60 // Regenerate every 60 seconds
  };
}

Pros: SSG performance + fresh data, scales infinitely
Cons: Stale data window, Next.js specific (mostly)

Decision Matrix

Use CaseStrategy
Blog, docs, marketingSSG
E-commerce product pagesISR
Dashboard, admin panelCSR
Social media feedSSR
News siteISR or SSR

Related Articles

MediumFrontend Engineering

System Design #12: Design a Multi-Step Form Wizard

7 min read
MediumFrontend Engineering

Mastering Senior-Level JavaScript Interview Concepts

2 min read
MediumFrontend Engineering

System Design #9: Design a Collaborative Text Editor

9 min read

Comments (0)

Sign in to leave a comment.

No comments yet. Be the first to comment.

Table of Contents

  • Client-Side Rendering (CSR)
  • Server-Side Rendering (SSR)
  • Static Site Generation (SSG)
  • Incremental Static Regeneration (ISR)
  • Decision Matrix

Series

View all Frontend Engineering articles →

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.