Guide
Rendering Strategy
The architectural decision of exactly when and where code is executed to generate HTML.
Published
Contents
Definition
The architectural decision of exactly when and where code is executed to generate HTML.
Rendering strategy determines whether your HTML is generated on the server at build time, on the server when a user requests it, or directly in the user’s browser via JavaScript.
Why It Matters
Your rendering strategy sets your absolute performance ceiling. If you choose to render an entire document-heavy site in the client’s browser (CSR), no amount of caching will fix the fact that the user must download and parse a massive JavaScript bundle before they can read the first paragraph.
The Core Distinctions
- Static Site Generation (SSG): HTML is built once on a server and served from a CDN. Unbeatable speed, but cannot show real-time user-specific data without client-side fetching.
- Server-Side Rendering (SSR): HTML is built on a server for every request. Good for personalized data, but requires paying for server compute time.
- Client-Side Rendering (CSR): A blank HTML shell is sent to the browser, and JavaScript draws the UI. Terrible for SEO and initial load, but great for highly interactive applications.
Related Concepts
- Read the full guide: Web Performance as Architecture
- See also: Hydration, Server Components