liveBook · Manning

Server-side rendering

As explained in Fast by Default

Server-side rendering generates a user interface's HTML on a server before sending the rendered content to the client.

Server-side rendering (SSR) generates complete HTML on the server, then sends it to the browser so users can see content without first waiting for client JavaScript to render a meaningful interface. It is an all-at-once rendering approach: the server waits for all required data before sending HTML. section 5.2.1

SSR changes where waiting occurs:

  • With client-side rendering (CSR), the browser receives a minimal HTML shell and waits to download and execute JavaScript before showing content; users may see a blank screen or loading indicator. section 5.2.1
  • With SSR, content can appear immediately after the rendered HTML arrives, but the response is blocked by the server's slowest data source. section 5.2.1
  • Streaming SSR and islands are progressive alternatives that send available chunks or hydrate components independently, trading simpler waiting behavior for added complexity or architectural constraints. section 5.2.1

High-traffic pages under real mobile conditions

A client-rendered homepage performed acceptably on powerful laptops and fast connections but left some mobile users waiting 10 seconds for UI. Moving high-traffic pages to Next.js SSR improved Largest Contentful Paint by 65% on the homepage and 67% on store pages; URLs rated poor for LCP fell by 95%. section 5.2.1

SSR is an architectural choice, not a late JavaScript optimization. Client-heavy designs can make server rendering difficult, so assess the existing architecture, actual user devices and networks, data-source latency, and the incremental migration options before committing to a rendering model. section 5.0 section 5.2.1

Table 5.1 Web rendering approaches
Rendering approach
Category
Waits for
Trade-offs
Server-Side Rendering
All-at-once
All data before sending HTML
Response blocked by server’s slowest data source
Client-Side Rendering
All-at-once
All JavaScript before rendering
User sees blank screen or loading indicator
Streaming SSR
Progressive
Nothing; sends chunks as ready
Added complexity
Islands
Progressive
Nothing; hydrates components independently
Architectural constraints

Compare SSR with CSR, streaming SSR, and islands by what each approach makes users wait for and the trade-off it introduces. section 5.2.1

How Fast by Default covers it

How deep it goes
Defines SSR, contrasts its waiting model with CSR and progressive approaches, and identifies slow server data as its limiting factor.
Examples
Illustrates SSR through DoorDash's Next.js migration for mobile users, reporting homepage and store-page LCP improvements.
What you can do after
Evaluate/understand SSR trade-offs against CSR, streaming SSR, and islands for users, data latency, and existing architecture.
How it connects
Connects SSR to client-side rendering, streaming SSR, islands, Largest Contentful Paint, and architectural performance constraints.

Also explained in

Compare how 13 books explain server-side rendering →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fast by Default. The section links point to the parts of the book it draws on.