October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Angular Rendering: What to Know About SSR, CSR, and Prerendering

Angular lets you choose CSR, prerendering, or request-time SSR route by route. Learn how rendering and hydration work, and what each option requires.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Angular can render a route in the browser, generate its HTML at build time, or render it on a server for each request. Its hybrid-rendering setup lets you choose per route: prerender stable public pages, use server-side rendering (SSR) when the initial response needs request-specific data, and keep browser-dependent routes client-rendered (CSR) where that fits. The right choice depends on the route’s data, server compatibility, deployment, and caching—not on a blanket promise of faster pages or higher rankings.

What happens when Angular renders on the server?

With SSR, Angular generates HTML on the server in response to a page request. The browser can receive a document containing rendered application content before it downloads and executes the full client application. Angular then starts in the browser and takes over the rendered page through hydration.

As an Amazon Associate I earn from qualifying purchases.

Hydration restores the server-rendered application on the client and reuses its DOM where possible. Angular’s hydration guide explains that without hydration, the server-rendered content is destroyed and rendered again in the browser, which can cause visible flicker and layout shifts. Angular CLI-created SSR applications include hydration.

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

SSR does not eliminate client-side JavaScript: it changes how the initial HTML is produced. The browser still initializes the application, and interactive behavior still depends on the client code.

How CSR, prerendering, and SSR differ

Mode When Angular renders HTML Visitor-specific data Rendering at request time Key trade-off
CSR (RenderMode.Client) In the browser Can be loaded after client logic runs No server rendering for the route Content may wait for JavaScript execution and data requests; browser-dependent features fit naturally.
Prerendering / SSG (RenderMode.Prerender) At build time No, not when the data varies by visitor No per-request rendering Static files can be served with little rendering work per request, but build time and deployment output can grow.
SSR (RenderMode.Server) On each request Yes, if implemented securely and scoped to that request Yes Provides rendered initial HTML, but requires server work and code that can run on the server.

Angular defines these modes in its RenderMode API reference. The Angular v20 SSR guide describes prerendering as generally favorable for SEO because crawlers receive rendered HTML. That does not establish a ranking guarantee: search outcomes depend on the site and implementation. Nor does a rendering mode alone establish which app will be faster; assess the actual routes and deployment.

Choose a mode based on each route

Use prerendering for stable, build-time content

Prerender pages when their content can be generated during the build and does not need to reflect the individual visitor or a value that changes at request time. An about page is a typical example. Static HTML can be served from a static host or CDN without rendering the page on every request.

For parameterized routes, Angular must be able to enumerate the needed route parameters during the build. Generating a large number of pages can increase build time, output size, and deployment time, so include page volume in the decision.

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

Use SSR for request-specific initial content

SSR suits routes whose initial HTML needs data available for a particular request, such as a profile page. It requires a server runtime to render the route, and the implementation must keep data correctly scoped to each request. Avoid caching personalized HTML in a shared cache in a way that could expose one visitor’s content to another.

Use CSR where browser behavior is central

CSR can be appropriate for browser-dependent functionality or routes where a browser-oriented development model is preferable. It avoids server-side rendering work for that route, but meaningful content may not appear until client JavaScript runs and any required data requests finish. Angular’s v20 guide also notes that client-rendered content can be subject to crawler limits on JavaScript execution.

Mix modes in one Angular app

Hybrid rendering means these choices do not have to be app-wide. Angular’s documented example assigns CSR to /, prerendering to a static /about route, and SSR to a personalized /profile route, with a server-rendered catch-all. These are examples, not mandatory assignments; map each route to its data needs and runtime constraints.

How to add SSR and configure route modes

Angular’s current hybrid-rendering guide documents these CLI entry points. Check the actual Angular version in your project before relying on version-sensitive command output or defaults.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. For a new application: create it with ng new --ssr.
  2. For an existing application: add SSR with ng add @angular/ssr.
  3. Assign rendering modes by route: in the server routes configuration, set each route to RenderMode.Client, RenderMode.Prerender, or RenderMode.Server, as appropriate to its data and runtime needs.
  4. Check parameterized prerender routes: ensure the values needed to generate their pages can be enumerated at build time.
  5. Choose an output and deployment that match: request-time SSR needs a server-side rendering runtime; static output can be hosted as files.

Angular’s hybrid-rendering guide documents outputMode: 'static', which produces prerendered HTML without generating a server file. Use it only when the needed route output can be created at build time. A static document cannot contain visitor-specific data unless the browser fetches that data later.

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

Check server compatibility and correctness

Code that assumes browser globals exist cannot automatically run during server rendering. Angular’s v19 SSR guidance identifies window, document, navigator, and location as examples that may be unavailable on the server. Keep browser-only work out of server execution paths. The v19 documentation describes afterRender and afterNextRender as browser-only hooks for browser-dependent operations; verify their current behavior against the Angular version your app uses.

  • Inspect the initial HTTP response and confirm it contains the expected route content.
  • Confirm hydration reuses the server-rendered DOM without visible replacement or mismatches.
  • Check that data included in returned HTML is safe and scoped to the correct request.
  • Review cache rules so personalized responses are not served to other visitors.
  • Estimate whether the number of prerendered parameter combinations is practical for your build and deployment.
  • Verify that the deployment supports the selected output: a server runtime for request-time SSR, or static-file hosting for static output.

Angular’s incremental hydration guide documents a related hydration feature. It is separate from the basic distinction between rendering a route on the client, at build time, or per request.

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.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

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
PC Slower Than It Used to Be?Free scan - under a minute
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.