Web Development

SSR, SSG or CSR? Choosing the Right Rendering Strategy for Your Web Application

How a page is rendered determines its speed, SEO and server costs. Here are the differences between SSR, static rendering and CSR, and when each one is the best fit.

By Oemah Solution Editorial Updated 3 min read

This article was translated from Bahasa Indonesia with AI assistance and reviewed by our team.

Close-up of a laptop screen displaying JavaScript code in a text editor
Photo: Macro laptop coding (Unsplash) by Marc Mueller seven11nash · CC0 · Wikimedia Commons

One of the most influential architectural decisions in a web project is where and when the HTML is generated. This choice affects how quickly a page appears, how responsive it feels to the touch, how easily search engines can index it, and even how much server capacity you need to pay for.

Key terms

The Rendering on the Web guide from web.dev defines several main approaches:

  • Server-side rendering (SSR) — rendering the application on the server and sending HTML, rather than JavaScript, to the browser.
  • Static rendering (SSG) — HTML is generated at build time, one file for each URL, before any visitor arrives.
  • Client-side rendering (CSR) — the application is rendered in the browser, with JavaScript modifying the DOM.
  • Hydration — running scripts in the browser to add state and interactivity to the HTML rendered by the server.
  • Streaming SSR — HTML is sent in stages, in small chunks, so the browser can start displaying the page earlier.

A quick comparison

Static rendering is the fastest and cheapest: the HTML is already built and can be cached on a CDN, so Time to First Byte (TTFB) is consistently low. The drawback is that content is only updated when you rebuild, which makes it less suitable for data that changes every minute or differs for each user.

SSR suits dynamic content that still needs to appear quickly and be SEO-friendly. Because the page is generated on request, TTFB can be higher than for static pages, but First Contentful Paint is generally fast.

CSR gives an app-like experience once loaded, but the initial display depends on downloading and executing JavaScript. The more JavaScript there is, the greater the risk that interactions feel slow, which is measured by the Interaction to Next Paint (INP) metric.

web.dev also warns about the rehydration trap: the page looks ready because the HTML has appeared, yet it cannot respond to input until the JavaScript has finished running. For this reason, the guide recommends considering SSR or static rendering over a full rehydration approach, and sending as little JavaScript as possible.

You don't have to pick just one for everything

Modern frameworks such as SvelteKit, Next.js and Nuxt allow a per-page strategy. In SvelteKit, for example, each route can be configured through page options: prerender to generate a static page at build time, and ssr and csr to enable or disable rendering on the server and in the browser.

A common way to divide things up:

Page type Suitable strategy
Company profile, service pages, documentation Static rendering
Blog, product catalogue, search results SSR (with caching)
Internal dashboard after login CSR or SSR with light JavaScript
Pages personalised for each visitor SSR without public caching

The oemahsolution.com site you are reading now, for example, is rendered on the server with SvelteKit so that blog articles are always up to date, appear quickly and can be indexed by search engines.

How to decide

  1. Measure first. Use Core Web Vitals data from real users to find where the bottlenecks are.
  2. Start with the simplest option. If a page can be static, make it static.
  3. Use SSR for dynamic content that needs to be indexed, and complement it with appropriate caching.
  4. Limit client-side JavaScript to the parts that are truly interactive.

A rendering strategy is not about following trends, but about matching the nature of the content to the needs of users and the business.

#web development#performance#ssr#seo

Sources & references

This article is a summary and interpretation by the Oemah Solution team of the sources below. Refer to the original sources for full details and context.

  1. Rendering on the Web web.dev (Google) · web.dev
  2. Page options SvelteKit Docs · svelte.dev
  3. Web Vitals web.dev (Google) · web.dev