SSR Rendering Process
Server-side rendering (SSR) is the technique of executing a JavaScript framework's rendering logic on the server to produce a fully-formed HTML string, which is sent to the browser and displayed before any client-side JavaScript executes.
Server-side rendering (SSR) is the technique of executing a JavaScript framework's rendering logic on the server to produce a fully-formed HTML string, which is sent to the browser and displayed before any client-side JavaScript executes.
The motivation is performance and SEO. In a pure client-side SPA, the browser receives a near-empty HTML shell and must download, parse, and execute JavaScript before rendering any content — a process that can take 2–5 seconds on mid-range mobile devices. With SSR, the server delivers complete HTML immediately, so the browser can paint meaningful content during the first HTTP response. Search engine crawlers also benefit because they can index the full page content without executing JavaScript.
The SSR process begins when a user requests a URL. The server (typically a Node.js process running the same framework code used on the client) receives the request, fetches any data required by the page (from databases, APIs, or cache), and runs the framework's render-to-string function — React's renderToString, Vue's @vue/server-renderer, or the equivalent. This produces an HTML string with all component output pre-rendered, plus a serialized representation of the data used (the dehydrated state) embedded in a tag.
The browser receives this HTML and can paint immediately without waiting for JavaScript. Once the JavaScript bundle loads, the hydration process attaches event listeners and restores framework state to the pre-rendered DOM, making the page interactive. Hydration is a critical second step — see Hydration Process for a detailed diagram of that phase.
SSR introduces architectural complexity: all rendering code must be isomorphic (runnable in both Node.js and browser environments), data fetching must happen before render, and server infrastructure must handle the CPU cost of rendering per request or must cache rendered output. Frameworks like Next.js, Nuxt, and SvelteKit abstract much of this complexity while supporting hybrid strategies (full SSR, static generation, incremental regeneration) to balance server load against freshness. See Web Performance Optimization for how SSR fits into a broader performance strategy.