DEV Community

Moosa Khan
Moosa Khan

Posted on

CSR vs SSR vs SSG vs ISR


Imagine you walk into a restaurant.

You’re hungry. You don’t care how the food is made, you just want it fast, fresh, and satisfying.

Now here’s the twist: different kitchens prepare your food in completely different ways. Some cook everything after you order. Some prepare meals in advance. Some update dishes quietly in the background. Some combine all of these.

That’s exactly how modern web apps deliver content.

Let’s break this down in a way that actually sticks.


The 4 Kitchens of the Web

1. CSR (Client Side Rendering) “Cook it at the table”

You sit down. The waiter brings you raw ingredients and a small stove. Now you cook your own food.

That’s CSR.

What happens technically:

The server sends a mostly empty HTML page
The browser downloads JavaScript
JavaScript builds the UI

Pros:

Very interactive, ideal for applications
Smooth experience after the initial load
Less work for the server

Cons:

Slow first load, often a blank screen at first
Weak SEO performance
Depends heavily on the user’s device

Use cases:

Dashboards and admin panels
SaaS applications
Tools like editors and builders

Example: Google Docs or a portfolio builder like your own product


2. SSR (Server Side Rendering) “Chef cooks fresh every time”

You order food. The chef prepares it fresh in the kitchen and serves it immediately.

That’s SSR.

What happens:

Request goes to the server
The server builds the full HTML
The page is sent ready to view

Pros:

Fast first meaningful load
Strong SEO performance
Always up to date data

Cons:

More load on the server
Slower response under heavy traffic
Navigation can feel less smooth

Use cases:

Blogs with dynamic content
E commerce product pages
News platforms

Example: Amazon product pages or a Twitter feed on first load


3. SSG (Static Site Generation) “Prepare everything before opening”

The chef prepares all meals before the restaurant opens. When customers arrive, everything is ready to serve instantly.

That’s SSG.

What happens:

Pages are generated at build time
Stored as static files
Served instantly from a CDN

Pros:

Extremely fast
Excellent SEO
Low hosting cost

Cons:

Not real time
Requires rebuilds for updates
Not suitable for frequently changing data

Use cases:

Portfolio websites
Landing pages
Documentation sites

Example: Personal portfolios or marketing pages


4. ISR (Incremental Static Regeneration) “Smart kitchen”

Now the kitchen becomes smarter.

Meals are pre prepared, but after some time they are updated quietly in the background without stopping service.

That’s ISR.

What happens:

Static page is served instantly
After a defined time, it regenerates in the background

Pros:

Fast like SSG
More fresh than static pages
Scales efficiently

Cons:

Slightly more complex to manage
Not truly real time
Requires careful cache timing

Use cases:

Blogs with periodic updates
Product listings
Marketplaces

Example: E commerce category pages or news sites that update regularly


Final Decision Guide

Use CSR when:

You are building an application
SEO is not critical
You need high interactivity

Example: dashboards or SaaS tools


Use SSR when:

You need fresh data on every request
SEO is important
Content changes frequently

Example: product detail pages


Use SSG when:

Content rarely changes
You want maximum performance
SEO is a priority

Example: portfolios and landing pages


Use ISR when:

You want a balance between speed and freshness
Content updates occasionally
You want to avoid full rebuilds

Example: blogs or marketplaces


The Simple Rule

App equals CSR
Real time data equals SSR
Static content equals SSG
Static with updates equals ISR


One Last Insight

Most real world applications do not rely on a single approach.

They combine multiple strategies.

Homepage can use SSG
Blog can use ISR
Dashboard can use CSR
Product pages can use SSR

Top comments (0)