When to render on server, at build time, or in the browser.
When to render on server, at build time, or in the browser.
CSR (Client-Side Rendering): the server sends a minimal HTML shell and JS; the browser runs the app and renders the UI. Fast navigation after load; first paint and SEO depend on JS. SSR (Server-Side Rendering): the server renders HTML per request; the client hydrates to make it interactive. Good first paint and SEO; needs a server per request.
SSG (Static Site Generation): HTML is generated at build time and served as static files. Cheapest and fastest; no server at request time. Good for content that does not change per user or request. Revalidate (ISR) or on-demand to update content.
Frameworks like Next.js let you choose per route: some pages SSG, some SSR, some CSR. Streaming (e.g. React Server Components) sends HTML in chunks so the shell and above-the-fold content can appear before the rest is ready, improving LCP.
Use SSG for marketing and docs; SSR for personalized or dynamic pages that need good first paint; CSR for highly interactive dashboards or tools where SEO is less critical.
Need SEO or fast first paint? Prefer SSG or SSR so crawlers and users see content without waiting for JS. Mostly interactive app, behind login? CSR is fine. Cost and ops: SSG is the cheapest (static hosting); SSR needs a running server; CSR needs a server for the shell and API.
[Building Micro-Frontends](https://www.oreilly.com/library/view/building-micro-frontends/9781492082996/) for deployment and composition across apps.
Key takeaways
Related concepts
Explore topics that connect to this one.
Ready to see how this works in the cloud?
Switch to Career Paths for structured paths (e.g. Developer, DevOps) and provider-specific lessons.
View role-based pathsSign in to track your progress and mark lessons complete.
Questions? Discuss in the community or start a thread below.
Join DiscordSign in to start or join a thread.