SSR, SSG or CSR: where your website should render, and how to check what you have
Client-side, server-side and static rendering compared by where the work happens, what each costs visitors and servers, and a per-section decision rule.
When you build a website, one decision shapes everything that follows: where the HTML a visitor sees is actually produced. In the browser, on your server on every request, or ahead of time at build? The three main answers - client-side rendering, server-side rendering and static generation - are not a progression from bad to good; they are different tools with different failure modes.
This guide follows the terminology and trade-offs in web.dev's "Rendering on the Web" (Addy Osmani and Jason Miller, last updated January 2026), checked on 20 November 2026.
CSR: the browser does the work
With client-side rendering, the server sends a nearly empty HTML shell plus JavaScript, and the browser downloads, parses and runs that JavaScript to build the page. This is the default shape of many single-page apps. Its strength is a smooth, app-like experience after load and simple static hosting. Its costs land on the visitor: content appears only after the JavaScript arrives and executes, which on a mid-range phone and a mediocre network can mean seconds of blank or loading UI, and anything that fails to run - a blocked script, an old browser - can mean no content at all. Search engines can render JavaScript, but rendering is slower and less certain than reading plain HTML, so content that must be found should not depend on it.
SSR: the server renders per request
With server-side rendering, the server produces the full HTML for each request, so the first screen arrives as readable content; JavaScript then "hydrates" it into an interactive app. First paint is fast and SEO gets real HTML, which is why web.dev's guidance broadly favours server or static rendering over a full client-rendered approach. The trade-offs move to your infrastructure: every page view runs rendering work on your servers, the time to first byte depends on your backend and data fetching, and you now operate a server (or serverless functions) with its scaling, caching and failure questions. Hydration also has a known trap: the page looks ready before it is interactive, and if the JavaScript bundle is heavy, taps can appear to do nothing for a moment.
SSG: render once, at build time
Static generation produces every page's HTML when you build and deploy, not when someone asks for it. Hosting becomes plain file serving - cheap, cacheable at the edge, and hard to break under load - while first paint and crawlability match server rendering. The limit is freshness and personalisation: content changes only when you rebuild, so a page that must reflect per-user or per-minute data is a poor fit for pure static output. Hybrid approaches exist - static shells with client-side or server-rendered islands, or revalidating selected pages on a schedule - but each hybrid reintroduces some of the complexity it was meant to avoid.
The decision rule
- Content pages that must be found and read fast - marketing pages, blogs, docs, listings: static generation first. Rebuild on publish; let a CDN absorb traffic.
- Pages that mix fresh or per-user data with content that must be indexed - dashboards with public previews, catalogues with live stock: server-side rendering. Budget for server capacity and cache aggressively at the page or fragment level.
- Signed-in, app-like surfaces behind a login - account areas, editors, internal tools: client-side rendering is often acceptable. Nobody needs to crawl them, and the interaction density justifies the JavaScript.
Many real sites split along exactly these lines: static marketing site, server-rendered catalogue, client-rendered app behind the login. Choosing per section beats choosing once for the whole product.
How to check what you have
- View source, not "inspect element". If the meaningful text of the page is in the initial HTML response, it is server- or static-rendered; if the response is a shell and a bundle, it is client-rendered.
- Disable JavaScript and reload. Whatever still reads correctly is what crawlers, archivers and failure cases see.
- Watch time to first byte versus time to content. A fast TTFB with a slow content paint points at client-side work; a slow TTFB points at server work.
Sources
- web.dev, Rendering on the Web (Osmani and Miller): https://web.dev/articles/rendering-on-the-web
Drafted with AI assistance from this source. Framework defaults and hosting features change; check your framework's current rendering options before committing, and measure on the devices and networks your visitors actually use.