# CSR, SSR, SSG, ISR and Streaming

> Where and when HTML is produced, and how each strategy affects performance, SEO, cost and complexity. Free notes, key concepts, resources and a mini project.

Canonical: https://www.internhack.in/roadmaps/tracks/frontend/rendering-strategies
Last updated: 2026-11-28

Where and when HTML is produced, and how each strategy affects performance, SEO, cost and complexity.

Intermediate · about 3 hours · difficulty 3/5

Learn first: [Client-Side Routing](https://www.internhack.in/roadmaps/tracks/frontend/client-routing), [Core Web Vitals and Performance Metrics](https://www.internhack.in/roadmaps/tracks/frontend/core-web-vitals), [SEO and Metadata Basics](https://www.internhack.in/roadmaps/tracks/frontend/seo-basics)

A plain Vite React app does **client-side rendering (CSR)**: the server sends an almost empty HTML file and JavaScript builds the page in the browser. That is fine for dashboards behind a login, but it delays content, hurts SEO for public pages and depends entirely on the device's speed. Meta-frameworks let you choose, per route, where HTML is generated.

### The strategies

- **CSR**: render in the browser. Simple hosting, rich interactivity, slower first content.
- **SSR (server-side rendering)**: render HTML on each request, then **hydrate** it in the browser to attach event handlers. Fresh, personalised and SEO friendly, but needs a server and adds per-request cost.
- **SSG (static site generation)**: render HTML at build time and serve it from a CDN. Fastest and cheapest, ideal for docs, blogs and marketing pages; content is only as fresh as the last build.
- **ISR / revalidation**: static pages that regenerate in the background after a time or on demand. Freshness without per-request rendering.
- **Streaming SSR**: send HTML in chunks as data resolves, using Suspense boundaries, so users see the shell immediately.
- **Islands and partial hydration**: ship static HTML and hydrate only interactive widgets (Astro's model). **Server Components** push the same idea further in React.
- **Edge rendering**: run SSR in data centres close to users.

### Hydration pitfalls

Server and client must render the same markup. Using `Date.now()`, `Math.random()`, `window` or locale-dependent formatting during render causes hydration mismatch errors.

### Choosing

Public, content-heavy pages favour SSG, ISR or SSR. Authenticated app screens can be CSR or SSR. Most real apps mix strategies per route.

### Good enough to move on

Given a set of pages (landing, blog, product, dashboard), you can pick a strategy for each and justify it in terms of freshness, SEO, performance and cost.

## Key concepts

- **Client-side rendering**
- **Server-side rendering and hydration**
- **Static site generation**
- **Incremental static regeneration**
- **Streaming SSR**
- **Islands and partial hydration**
- **Edge rendering**
- **Hydration mismatches**

## Mini project

Write a one-page architecture note for an e-commerce site choosing a rendering strategy for home, category, product, cart, account and blog pages, with reasons and expected trade-offs.

## Check yourself

Why does rendering the current time directly in a server-rendered component often cause a hydration warning?

## Free resources

- [Rendering on the Web](https://web.dev/articles/rendering-on-the-web) (web.dev)
- [Server rendering APIs](https://react.dev/reference/react-dom/server) (react.dev)

Previous: [Content Security Policy and Supply-Chain Safety](https://www.internhack.in/roadmaps/tracks/frontend/csp) · Next: [Next.js](https://www.internhack.in/roadmaps/tracks/frontend/nextjs)

## More in Rendering Strategies and Meta-Frameworks

- [CSR, SSR, SSG, ISR and Streaming](https://www.internhack.in/roadmaps/tracks/frontend/rendering-strategies)
- [Next.js](https://www.internhack.in/roadmaps/tracks/frontend/nextjs)
- [React Router Framework Mode (Remix)](https://www.internhack.in/roadmaps/tracks/frontend/react-router-framework)
- [Nuxt](https://www.internhack.in/roadmaps/tracks/frontend/nuxt)
- [Astro](https://www.internhack.in/roadmaps/tracks/frontend/astro)
- [SvelteKit](https://www.internhack.in/roadmaps/tracks/frontend/sveltekit)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Frontend Developer Roadmap](https://www.internhack.in/roadmaps/tracks/frontend)
