How SSR works
When a page is requested, the server does all the rendering work: it queries the database, applies
the template, builds the HTML and sends a finished document to the browser. The browser receives a
complete page with content and does not need to execute JavaScript for the first render.
SSR flow:
Browser → GET /product/123 → Server
→ fetch product data
→ fetch recommendations (API)
→ render HTML template
→ return full HTML
CSR flow:
Browser → GET / → Server → empty HTML + JS bundle
Browser → execute JS → fetch product/123 → render DOM
Comparing rendering approaches
| Approach | SEO | First contentful paint | Personalization | Server load |
|---|---|---|---|---|
| SSR | Excellent | Fast | On the server | High |
| CSR | Poor | Slow | Client-side | Low |
| SSG | Excellent | Very fast | None or limited | Minimal |
| Hydration (SSR + CSR) | Excellent | Fast | Server plus client | Medium |
SSR and personalization
Server rendering enables the highest-quality form of personalization: recommendations and
personalized content are embedded in the HTML on the server. The user sees a personalized page from
the first byte — no flicker, no flash of unstyled content, no wait for client-side initialisation.
That matters most for:
- PLP — the ordering of products in a listing, personalized to the user
- Homepage — a hero block with personalized recommendations
- PDP — a similar products block with no loading delay
Important: with SSR personalization, API response time becomes critical. A call to the
recommendations API blocks HTML rendering. The answer is an aggressive recommendations cache, or
async SSR with parallel requests.
Caching in SSR
To reduce server load, SSR pages are cached at the CDN — which conflicts with personalization, since
you cannot serve different users the same cached HTML. The standard approaches:
- Edge personalization — the cache holds the base HTML and personalization is added at the CDN
edge through a client-side script - Fragment caching — shared parts of the page are cached while personalized fragments are
generated fresh - Cookie-based routing — the CDN reads the user’s segment and serves the matching cache variant