Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

Angular Server-Side and Hybrid Rendering: SSR, Prerendering, and CSR

Angular can render different routes with SSR, prerendering, or CSR. Compare when each fits and what to know about hydration, static deployment, and route configuration.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Angular lets you choose how each route is rendered: on the server for every request (SSR), at build time as static HTML (prerendering or SSG), or in the browser (CSR). You can combine these modes in one app. The right choice depends on whether content must be fresh or personalized, what your hosting can run, and how much work you want to move to build time or the browser.

How Angular’s rendering modes differ

Angular calls an app that mixes server-side rendering, prerendering, and client-side rendering a hybrid-rendered app. These are qualitative trade-offs, not guarantees of speed, search visibility, or cost; evaluate representative routes in your own deployment.

Mode When rendering happens Best fit Main trade-off
Server-side rendering (SSR) On the server for each request Frequently changing or request-specific content Requires server rendering capacity and request-time work
Prerendering / static site generation (SSG) At build time; Angular generates HTML documents Stable public pages whose content is available at build time Build time and output artifacts can grow with the number of generated routes; output cannot be personalized for the requesting user
Client-side rendering (CSR) In the browser Interactive or browser-dependent pages, including apps that fetch data client-side Users must download, parse, and run JavaScript, and may wait for client-side data requests before the complete content appears

SSR and prerendering can deliver rendered HTML before the browser finishes running the app. CSR avoids rendering pages on a server, but search crawlers may vary in their ability to execute JavaScript. Offline or service-worker applications may also favor CSR. Neither mode guarantees a particular search or performance result.

When to choose SSR, prerendering, or CSR

Choose SSR for request-specific or frequently changing pages

SSR is the natural option when a page needs current data or content tailored to the incoming request. Because the server renders each request, it can use request-specific information. Account for the server capacity and runtime behavior that this requires.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose prerendering for shared content known at build time

Prerender pages such as stable public information that can be generated before deployment and served as static files. This avoids per-request page rendering, but the output is shared rather than personalized. Each route to generate adds work and potentially another document to the build artifact, so consider route count and content freshness.

Choose CSR when browser execution is part of the requirement

CSR suits routes that rely on browser-only code or whose content is fetched after the app starts. It avoids server-side page rendering, but the rendered content depends on JavaScript execution and any client-side requests. Consider that delay when deciding what users should see immediately.

Use different modes for different routes

There is no need to choose one mode for the entire app. For example, a team might render an interactive browser-dependent tool with CSR, prerender a stable public page, and use SSR for a profile page that varies by request. Treat this as a starting point: the page’s data needs, hosting, and measured behavior should decide the actual route configuration.

Configure rendering by route

Angular’s hybrid-rendering guide documents ng new --ssr when creating a project and ng add @angular/ssr for an existing one. Server routes are expressed as ServerRoute entries, commonly in app.routes.server.ts, and registered with the server-rendering providers. See Angular’s server and hybrid rendering guide for the current configuration API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A route map assigns a rendering mode to each path. The exact route definitions and providers depend on your project setup and Angular version; the important decision is to match each path to its content and runtime needs.

Prerender parameterized routes

For routes with parameters, getPrerenderParams provides the parameter values Angular should use to generate documents at build time. If a requested path was not generated, a prerender route can define a fallback: server rendering, client rendering, or no fallback. Choose based on whether ungenerated paths must still work and what runtime your deployment supports.

Deploy a fully static output

For static hosting, Angular documents setting outputMode to "static". This produces prerendered HTML without generating a server file, so the result can be served from a static file server or CDN. This is appropriate only when the pages you need can be generated at build time; static output does not provide per-request personalization.

Hydration: reuse the rendered page in the browser

Hydration allows Angular to reuse the DOM produced by server rendering rather than discard it and render the page again. Without hydration, destroying and rebuilding the DOM can cause flicker and layout shifts. Angular’s hydration guide documents provideClientHydration for enabling hydration; Angular CLI’s SSR setup includes it. See Angular’s hydration guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The server and browser must produce consistent output for hydration to work reliably. Angular warns against using isPlatformBrowser in template conditionals to render different content on the server and client: the mismatch can interfere with hydration and cause layout shifts. Prefer platform-specific providers where possible, and avoid making the initial template depend on different server and browser conditions.

Server provider values and request isolation

Angular notes that top-level server provider values can persist across requests because application code is parsed and evaluated once. If a value must be created separately for each request, use a factory provider. This distinction matters when server-side state could otherwise be unintentionally shared between requests.

HTTP transfer cache

Angular can transfer eligible HTTP responses from SSR to hydration. By default, eligible GET and HEAD requests are transferred, but exclusions include authorization- or cookie-related credentials, cache-control directives such as no-store, no-cache, or private, and responses carrying Set-Cookie. The filtering details are version-sensitive; check the current Angular guide before relying on a particular request being cached.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Incremental hydration for deferred sections

Incremental hydration builds on SSR, hydration, deferrable views, and event replay. It lets deferred parts of a page remain dehydrated until a configured trigger tells Angular to hydrate them. That can defer browser work for sections that do not need to become interactive immediately, while keeping the server-rendered page available. Angular’s current guide says incremental hydration is enabled by default when using provideClientHydration, and event replay is enabled automatically; verify these defaults against your project’s Angular version. See Angular’s incremental hydration guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make the decision against your real app

  • Use SSR when request-time data or personalization is essential and you can operate server rendering.
  • Use prerendering when content is shared, available at build time, and suitable for static delivery.
  • Use CSR when browser-only behavior or client-side fetching is needed and the rendering delay is acceptable.
  • Mix modes by route rather than imposing one strategy on pages with different requirements.
  • Check that server and client initial output match, and verify hydration and transfer-cache behavior for your Angular version.
  • Measure representative pages under your actual hosting and data conditions; the rendering mode alone does not establish a performance or SEO outcome.

For current details on routing and what happens after hydration, consult Angular’s rendering strategies guide. Its performance overview also discusses rendering, hydration, and incremental hydration.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.