Server-side rendering (SSR) generates HTML for a requested page on the server. Server logic can query a database, merge the results with a template, and send ready HTML to the browser. Unlike static site generation, which creates HTML ahead of deployment, SSR does that work when a request arrives. section 2.1.4
Choose SSR when a public route should return meaningful HTML without waiting for client-side JavaScript. It fits readable URLs and makes content available to browsers, crawlers, and tools that fetch pages. It is not the same as a shell-based single-page app: a shell returns an entry document, then a client router renders the requested view. section 10.1.1 section 10.2
Rendering an article request
A server receives a request for an article, queries its content, inserts it into an HTML template, and returns the resulting page. A direct visit to that route can receive the article itself rather than an empty shell awaiting client rendering. section 2.1.4 section 10.2
Keep the server’s routing contract explicit:
- Return route-specific HTML for valid SSR pages, including direct visits to their URLs. section 10.2
- Use real links, redirects, and HTTP status codes; do not answer every unknown path with a 200 OK. section 10.1.1 section 10.2
- Treat client-side transitions as an enhancement: links and routes should still work without interception or in-memory client state. section 10.1.1
SSR does not rule out client-side interaction. Universal rendering starts with server-generated HTML, then hydrates it so client-side code can take over interactivity. Choose that additional layer when its behavior is needed, rather than treating hydration as part of SSR itself. section 2.1.4
Table 2.2 Rendering models cheat sheet
| Rendering model | What you code | What you build and ship | What the server does on request | What the client does |
Static Site |
You code raw HTML, CSS, and JS files directly. |
None – you ship the files as-is. |
The server serves static files (no logic). |
The browser renders HTML, applies CSS, and executes minimal JS. |
SSG |
You code templates + content sources (Markdown, DB, CMS). |
A build step generates static HTML/JS/CSS files. |
The server only serves the pre-generated files, similar to a Static Site. |
The browser renders static pages, with optional JS for interactivity. |
SSR |
You code templates + server logic (PHP, Node, Python, etc.). |
Optional pre-compilation of templates or code. Ship source code or compiled binaries. |
On each request, the server queries the DB, merges data with templates, and outputs HTML. |
The browser receives ready HTML and CSS, plus optional JS that enhances interactivity. |
CSR |
You code mostly JS + an HTML shell + API endpoints. |
Optional tooling. Ship source code. |
The server serves static files, similar to a Static Site, and also provides JSON endpoints. |
The browser runs JS, manages the DOM, and fetches data via APIs. |
Universal |
You code with a framework whose code runs both client- and server-side (typically JS). |
A build step produces server and client bundles. Ship both to a Node-capable host. |
On each request, the server renders the initial HTML for the route. |
The browser displays the server-rendered HTML, then hydrates it to take over interactivity. |
ISR |
You code templates + content sources with a framework that supports revalidation. |
A build step pre-generates pages; you configure revalidation rules. Ship to a platform with a cache and runtime. |
The server serves cached static HTML and regenerates pages in the background, on a schedule or on-demand. |
The browser renders the pre-generated HTML, then optionally hydrates for interactivity. |
Islands |
You code mostly static templates + isolated interactive components, such as custom elements. |
A build step outputs static HTML plus small, per-island JS bundles. |
The server serves static HTML (like SSG), optionally rendering per request. |
The browser renders the static HTML and hydrates only the islands independently – or resumes them, in Qwik’s case. |
Compare when each rendering model produces HTML and what the server sends in response to a request. section 2.1.4












