Skip to content

Angular (SSR)

Angular (SSR) scores 18 of 28 points. That is 9 of 14 on the 7 features that affect first paint (the moment the browser first draws content), and 9 of 14 on the 7 other features.

Rank 7 of 2318/28 points: 9/14 first-paint, 9/14 other · 64% complete
Version checked
@angular/ssr 22.2.6 and @angular/core 22.2.5 (npm latest when checked; latest is now 22.3.0 for both and angular.dev is built at v22.3.0)
Version notes
The angular-books port locks @angular/ssr 22.2.7 and @angular/core 22.2.6.
Performance guide
Performance • Overview • Angular
Issues
github.com/angular/angular/issues

Scorecard

All 14 features, in two groups. Each row shows Angular (SSR)'s label, how that label compares across all 23 frameworks, and how to enable the feature. Feature names link to Angular (SSR)'s entry on that feature's page.

Angular (SSR)'s labels across 14 features

  • 1st-party8
  • Experimental0
  • Third-party2
  • Manual4
  • of 14

How it compares

On 8 of 14 features, no framework has a higher-scoring label than Angular (SSR). On the other 6, at least one does.

Tested in our port

The angular-books port passes 10/11 feature tests (failed: Font optimization). Run on 2026-11-27 at MaxwellCohen/angular-books@4beef3e. How we test labels

First-paint levers

9/14
  • 1st-party, like 7 of the other 22 frameworks. None scores higher.

    Show the how-to

    optimization.styles.inlineCritical defaults to true; critical CSS is inlined and the rest loads async. On in the default production config. (workspace-config, build)

    Code example

    Critical CSS inlining is part of the production optimization setting. Angular inlines the CSS the first page needs and loads the rest of the stylesheet async.

    // angular.json
    {
      "projects": {
        "books": {
          "architect": {
            "build": {
              "builder": "@angular/build:application",
              "configurations": {
                "production": {
                  "optimization": {
                    "scripts": true,
                    "styles": { "minify": true, "inlineCritical": true },
                    "fonts": true
                  }
                }
              }
            }
          }
        }
      }
    }

    Source: Angular: Workspace configuration

  • 02Font optimizationThird-party1 pt

    Third-party, like 18 of the other 22 frameworks. 4 frameworks score higher.

    Tested in our port: failed
    Show the how-to and test

    optimization.fonts.inline (default true) inlines external Google Fonts and Adobe Fonts CSS into the index HTML (needs internet at build). That removes one render-blocking stylesheet request, but the font files still load from the font host; no self-hosting, subsetting, or preload is documented. Self-hosting needs a package such as Fontsource, as for React Router, Qwik City, Marko, and Fresh. Our feature test confirmed this: with fonts.inline on, the Google CSS was inlined and the font file was still fetched from fonts.gstatic.com. (workspace-config, Fontsource)

    Code example

    Link a Google Fonts stylesheet in index.html as usual. With optimization.fonts.inline on, the production build downloads that CSS and inlines it into the HTML, removing one render-blocking request.

    <!-- src/index.html -->
    <head>
      <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
      <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet" />
    </head>
    // angular.json (production configuration; needs internet access at build time)
    "optimization": {
      "fonts": { "inline": true }
    }

    Source: Angular: Workspace configuration

  • 03Image pipeline1st-party2 pts

    1st-party, like 8 of the other 22 frameworks. None scores higher.

    Show the how-to

    NgOptimizedImage: priority (fetchpriority=high, eager, SSR preload link), auto srcset, placeholder blur, lazy by default. Built-in loaders for Cloudflare Image Resizing, Cloudinary, ImageKit, Imgix, Netlify; it does not resize itself (the default loader is a no-op). (image-optimization)

    Code example

    NgOptimizedImage with a built-in loader. The loader builds CDN URLs for each ngSrcset width; priority marks the LCP image and placeholder shows a low-res blur from the same CDN.

    // src/app/app.config.ts
    import { provideImgixLoader } from '@angular/common';
    
    export const appConfig: ApplicationConfig = {
      providers: [provideImgixLoader('https://books.imgix.net/')],
    };
    
    // src/app/book/book-cover.ts
    import { NgOptimizedImage } from '@angular/common';
    
    @Component({
      selector: 'app-book-cover',
      imports: [NgOptimizedImage],
      template: `
        <img [ngSrc]="src()" width="400" height="600" [alt]="title()"
             ngSrcset="200w, 400w, 800w" sizes="(max-width: 640px) 50vw, 200px"
             [priority]="priority()" placeholder />
      `,
    })
    export class BookCover { /* … */ }

    Source: Angular: Getting started with NgOptimizedImage

    Art direction with <picture>

    Manual

    Serving a different crop or format per screen size. Not scored: the label shows how much the framework does for you.

    The NgOptimizedImage page says <picture> is not supported yet ("on our roadmap"); no art direction or <source type> format fallback is documented. Format is left to the configured image-CDN loader (the page says only that the loader sets "size, format, and image quality transformations"). No first-party <picture> documented; hand-write it. (image-optimization)

    Example

    NgOptimizedImage can't render <picture>, so write the element in a component template with plain <source> tags for format fallback and art direction.

    // src/app/home/hero-image.ts
    import { ChangeDetectionStrategy, Component } from '@angular/core';
    
    @Component({
      selector: 'app-hero-image',
      changeDetection: ChangeDetectionStrategy.OnPush,
      template: `
        <picture>
          <!-- art direction: a square crop on narrow screens -->
          <source media="(max-width: 640px)" type="image/avif"
                  srcset="/media/hero-square-640.avif" width="640" height="640" />
          <!-- format fallback: AVIF, then WebP, then the <img> JPEG -->
          <source type="image/avif" sizes="100vw"
                  srcset="/media/hero-1280.avif 1280w, /media/hero-1920.avif 1920w" />
          <source type="image/webp" sizes="100vw"
                  srcset="/media/hero-1280.webp 1280w, /media/hero-1920.webp 1920w" />
          <img src="/media/hero-1280.jpg" alt="Shelves of books" width="1280" height="720"
               fetchpriority="high" decoding="async" />
        </picture>
      `,
    })
    export class HeroImage {}

    Source: Angular image optimization FAQ

  • 04Data/HTML caching1st-party2 pts

    1st-party, like 16 of the other 22 frameworks. None scores higher.

    Show the how-to

    RenderMode.Prerender build-time HTML; the HttpClient transfer cache (withHttpTransferCacheOptions) reuses SSR responses on hydration; per-route headers. No ISR/revalidate or server data cache documented. (ssr, withHttpTransferCacheOptions)

    Code example

    Prerender stable pages at build time, and let the HttpClient transfer cache hand SSR responses to the browser so hydration does not fetch them again.

    // src/app/app.routes.server.ts
    export const serverRoutes: ServerRoute[] = [
      { path: 'about', renderMode: RenderMode.Prerender },
      { path: '**', renderMode: RenderMode.Server, headers: { 'Cache-Control': 'public, max-age=60' } },
    ];
    
    // src/app/app.config.ts
    import { provideClientHydration, withHttpTransferCacheOptions } from '@angular/platform-browser';
    
    providers: [
      provideClientHydration(
        withHttpTransferCacheOptions({
          includeHeaders: ['ETag', 'Cache-Control'],
          filter: (req) => !req.url.includes('/api/profile'),
          includePostRequests: false,
        }),
      ),
    ],

    Source: Angular: Server and hybrid rendering

  • 05Route prefetching1st-party2 pts

    1st-party, like 18 of the other 22 frameworks. None scores higher.

    Show the how-to

    Opt-in withPreloading(PreloadAllModules) preloads lazy route chunks; @defer has prefetch on idle/viewport/hover. No link hover/viewport prefetch documented. The default strategy is NoPreloading, so nothing is preloaded until withPreloading(...) is added. (NoPreloading, PreloadAllModules, defer)

    Code example

    The router preloads nothing by default (NoPreloading). Add withPreloading(PreloadAllModules) to fetch every lazy route chunk after the app starts. @defer blocks take their own prefetch trigger.

    // src/app/app.config.ts
    import { ApplicationConfig } from '@angular/core';
    import { provideRouter, withPreloading, PreloadAllModules } from '@angular/router';
    import { routes } from './app.routes';
    
    export const appConfig: ApplicationConfig = {
      providers: [provideRouter(routes, withPreloading(PreloadAllModules))],
    };
    <!-- any template: load the chunk on interaction, prefetch it when the browser is idle -->
    @defer (on interaction; prefetch on idle) {
      <app-book-reviews />
    } @placeholder {
      <button>Show reviews</button>
    }

    Source: Angular: Customizing route behavior

  • 06Streaming SSRManual0 pts

    Manual, like 2 of the other 22 frameworks. 20 frameworks score higher.

    Show the how-to

    No streaming render documented. The SSR guide describes rendering the page to a complete HTML document and then sending it, and the word "stream" does not appear in it. (ssr)

    Code example

    Angular renders the whole document before sending it. To get bytes out sooner, flush a fixed <head> from the Express handler while Angular renders, then send the rest of Angular's HTML. The status code and head are fixed before rendering starts.

    // src/server.ts
    import { AngularNodeAppEngine } from '@angular/ssr/node';
    import express from 'express';
    
    const app = express();
    const angularApp = new AngularNodeAppEngine();
    // Copy the <head> of the built index.server.html, with its hashed CSS link.
    const HEAD = `<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Books</title>
    <link rel="stylesheet" href="/styles-HASH.css"></head>`;
    
    app.use(async (req, res, next) => {
      if (!req.accepts('html')) return next();
      res.status(200).type('html').write(HEAD); // sent before Angular renders
      const response = await angularApp.handle(req);
      const html = response ? await response.text() : '<body></body>';
      res.end(html.slice(html.indexOf('</head>') + '</head>'.length)); // body only
    });

    Source: Angular: Server-side rendering

  • Manual, like 15 of the other 22 frameworks. 7 frameworks score higher.

    Show the how-to

    No first-party preload Link headers or 103 Early Hints documented. Per-route headers in ServerRoute and RESPONSE_INIT can set a Link header by hand. (ssr)

    Code example

    Add a Link header to the server route's headers. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.

    // src/app/app.routes.server.ts
    import { RenderMode, ServerRoute } from '@angular/ssr';
    
    export const serverRoutes: ServerRoute[] = [
      {
        path: '**',
        renderMode: RenderMode.Server,
        headers: { Link: '<https://fonts.gstatic.com>; rel=preconnect; crossorigin' },
      },
    ];

    Source: Angular SSR: setting headers and status codes

Other features

9/14
  • 1st-party, like 14 of the other 22 frameworks. None scores higher.

    Show the how-to

    Incremental hydration via @defer with hydrate on idle/viewport/interaction/hover/immediate/timer/when and hydrate never; the v22 guide says it is enabled by default with provideClientHydration(). Stable since v20 per the roadmap (developer preview in v19), and on by default since v22.0.0, when withIncrementalHydration was deprecated (withIncrementalHydration); the v22 guide pages carry no stability label. (incremental-hydration, hydration)

    Code example

    Incremental hydration is on by default with provideClientHydration(). A @defer block with a hydrate trigger renders on the server and stays dehydrated until the trigger fires.

    // src/app/app.config.ts
    providers: [provideClientHydration()],
    <!-- src/app/pages/book.page.ts template -->
    <app-book-detail [book]="book()" />
    
    @defer (hydrate on viewport) {
      <app-related-books [bookId]="book().id" />
    }
    
    @defer (on viewport; hydrate never) {
      <app-static-footer />
    }

    Source: Angular: Incremental hydration

  • 1st-party, like 18 of the other 22 frameworks. None scores higher.

    Show the how-to

    ServerRoute[] in app.routes.server.ts with RenderMode.Server/Client/Prerender; getPrerenderParams, fallback, per-route headers/status; outputMode: "static" for server-less builds. Stable since v20 per the roadmap (developer preview in v19); the guide itself carries no stability label. (ssr)

    Code example

    Each route picks a render mode in app.routes.server.ts: per-request SSR, build-time prerender, or client-only.

    // src/app/app.routes.server.ts
    import { inject } from '@angular/core';
    import { RenderMode, PrerenderFallback, ServerRoute } from '@angular/ssr';
    
    export const serverRoutes: ServerRoute[] = [
      { path: '', renderMode: RenderMode.Server },
      { path: 'about', renderMode: RenderMode.Prerender },
      { path: 'account', renderMode: RenderMode.Client },
      {
        path: 'book/:id',
        renderMode: RenderMode.Prerender,
        fallback: PrerenderFallback.Server,
        async getPrerenderParams() {
          const ids = await inject(BooksApi).topIds();
          return ids.map((id) => ({ id }));
        },
      },
      { path: '**', renderMode: RenderMode.Server, status: 404 },
    ];

    Source: Angular: Server and hybrid rendering

  • 1st-party, like 21 of the other 22 frameworks. None scores higher.

    Show the how-to

    Signals (signal, computed, linkedSignal, effect, resource) track dependencies dynamically; zoneless is default from v21. The page gives no stability label. (signals, zoneless)

    Code example

    From the Books port's cover component: input() and signal() hold state, computed() derives from them, and the template re-renders only what reads a changed signal.

    // src/app/book/book-cover.ts
    import { ChangeDetectionStrategy, Component, computed, input, signal } from '@angular/core';
    
    @Component({
      selector: 'app-book-cover',
      changeDetection: ChangeDetectionStrategy.OnPush,
      template: `
        @if (showImage()) {
          <img [src]="readySrc()" [alt]="title()" (error)="failedSrc.set(readySrc())" />
        } @else {
          <div role="img">Cover unavailable</div>
        }
      `,
    })
    export class BookCover {
      readonly title = input.required<string>();
      readonly src = input.required<string | null>();
      protected readonly failedSrc = signal<string | null>(null);
      protected readonly readySrc = computed(() => getLargeBookImageUrl(this.src() ?? EMPTY_IMAGE_URL));
      protected readonly showImage = computed(() => this.readySrc() !== this.failedSrc());
    }

    Source: Angular: Signals

  • Third-party, like 18 of the other 22 frameworks. 2 frameworks score higher.

    Show the how-to

    ng build --stats-json writes a stats file for an external esbuild analyzer; default budgets warn 500kb/error 1mb on initial. The viewer is external. (build, build)

    Code example

    --stats-json writes browser-stats.json (and server-stats.json with SSR). Load it into the esbuild analyzer at esbuild.github.io/analyze. Budgets in angular.json fail the build when bundles grow.

    ng build --stats-json
    # then open https://esbuild.github.io/analyze/ and load dist/books/browser-stats.json
    // angular.json, configurations.production
    "budgets": [
      { "type": "initial", "maximumWarning": "500kB", "maximumError": "1MB" },
      { "type": "anyComponentStyle", "maximumWarning": "4kB", "maximumError": "8kB" }
    ]

    Source: Angular CLI: ng build

  • Manual, like 16 of the other 22 frameworks. 6 frameworks score higher.

    Show the how-to

    No first-party script-loading primitive documented (the runtime-performance page lists none). Rests on absence. (runtime-performance)

    Code example

    Put the loading strategy in the tag yourself: async in src/index.html for early scripts, or afterNextRender to inject one after the first browser render.

    // src/index.html: loads in parallel, runs as soon as it arrives
    // <script async src="https://plausible.io/js/script.js" data-domain="books.example"></script>
    
    // src/app/app.ts: load a chat widget only in the browser, after first render
    import { Component, afterNextRender } from '@angular/core';
    
    @Component({ selector: 'app-root', templateUrl: './app.html' })
    export class App {
      constructor() {
        afterNextRender(() => {
          // Never runs during SSR; wait for idle so the widget doesn't compete with hydration.
          (window.requestIdleCallback ?? setTimeout)(() => {
            const s = document.createElement('script');
            s.src = 'https://widget.example.com/chat.js';
            s.async = true;
            document.body.append(s);
          });
        });
      }
    }

    Source: afterNextRender

  • Manual, like 8 of the other 22 frameworks. 14 frameworks score higher.

    Show the how-to

    Web-standard AngularAppEngine / createRequestHandler is portable, with AngularNodeAppEngine for Node and outputMode: "static". SSR is documented for Node (first-party), Netlify (host-maintained @netlify/angular-runtime, Edge Function) and Cloudflare Workers: the Cloudflare guide scaffolds an SSR Worker through create-cloudflare --framework=angular (AngularAppEngine, ssr.platform: "neutral"), maintained by Cloudflare rather than the Angular team, though the guide page itself does not mention SSR and its automatic-configuration example is assets-only. Vercel lists Angular only as a zero-config frontend framework and no Vercel Angular SSR page was found, so the four hosts this repo targets are not all covered. The deployment page also lists third-party ng deploy builders. This portability judgment is lower confidence. (ssr, angular, angular, frontend, deployment)

    Code example

    From the port: one AngularAppEngine handler per host, each picked by a build configuration in angular.json. Vercel reuses the Node/Express build behind a function.

    // angular-books/src/server.cloudflare.ts (Netlify's server.netlify.ts is the same shape)
    import { AngularAppEngine, createRequestHandler } from '@angular/ssr';
    // …
    const angularAppEngine = new AngularAppEngine();
    
    async function handle(request: Request): Promise<Response> {
      const result = await angularAppEngine.handle(request);
      return result || new Response('Not found', { status: 404 });
    }
    
    export const reqHandler = createRequestHandler(handle);
    export default { fetch: (request: Request) => handle(request) };
    
    // angular-books/angular.json, build.configurations: one SSR entry per host
    // "node":       { "ssr": { "entry": "src/server.ts" } },
    // "cloudflare": { "ssr": { "entry": "src/server.cloudflare.ts", "platform": "neutral" } },
    // "netlify":    {}  // default "ssr.entry": "src/server.netlify.ts"
    
    // angular-books/api/index.js: Vercel function wrapping the Express build
    // handler ??= (await import('../dist/angular-books/server/server.mjs')).reqHandler;

    Source: Angular SSR

  • 1st-party, like 1 of the other 22 frameworks. None scores higher.

    Show the how-to

    ng add @angular/pwa adds @angular/service-worker, registers it, and creates ngsw-config.json; the build writes the hashed asset manifest, and the worker caches the app shell and configured data groups. (getting-started, service-workers)

    Code example

    ng add @angular/pwa adds @angular/service-worker, registers it in the app config and creates ngsw-config.json. The build writes the asset manifest the worker uses.

    // src/app/app.config.ts
    import { ApplicationConfig, isDevMode } from '@angular/core';
    import { provideServiceWorker } from '@angular/service-worker';
    
    export const appConfig: ApplicationConfig = {
      providers: [
        provideServiceWorker('ngsw-worker.js', {
          enabled: !isDevMode(),
          registrationStrategy: 'registerWhenStable:30000',
        }),
      ],
    };
    // ngsw-config.json
    {
      "index": "/index.html",
      "assetGroups": [
        { "name": "app", "installMode": "prefetch",
          "resources": { "files": ["/favicon.ico", "/index.html", "/*.css", "/*.js"] } }
      ],
      "dataGroups": [
        { "name": "api", "urls": ["/api/**"],
          "cacheConfig": { "strategy": "performance", "maxSize": 100, "maxAge": "1d" } }
      ]
    }

    Source: Angular: Getting started with service workers, Angular: Service worker configuration

1st-party scores 2 points, Experimental and Third-party 1, Manual 0. How scoring works

The port

The books demo app built with this framework, and where each branch is deployed.

Latest benchmark

Mobile Lighthouse lab results from PageSpeed Insights on : the median of 3 runs per host, averaged across the hosts listed. The benchmark page explains each metric and has every other framework.

Angular (SSR): latest benchmark per build and page
BuildPathPerfFCPRaw FCPLCPTBTCLSSITTIDocHosts
Book list /
baseline/89(good)0.780.36(needs improvement)3.76(good)28(good)0.0001.153.762703/3 Vercel, Netlify, Cloudflare
optimized/87(good)0.801.44(needs improvement)3.91(good)35(good)0.0002.503.912743/3 Vercel, Netlify, Cloudflare
Book page /10145787
baseline/1014578799(good)0.780.23(good)2.06(good)3(good)0.0001.082.191763/3 Vercel, Netlify, Cloudflare
optimized/1014578799(good)0.781.13(good)2.22(good)26(good)0.0002.252.332183/3 Vercel, Netlify, Cloudflare
  • Good
  • Needs improvement
  • Poor

FCP 1.8 s / 3 s · LCP 2.5 s / 4 s · TBT 200 ms / 600 ms · CLS 0.1 / 0.25

Per host

The medians above before averaging. Runs is how many measured runs went into each median. Host names link to the deployment.

Angular (SSR): latest benchmark per build, page and host
BuildPathHostPerfFCPRaw FCPLCPTBTCLSSITTIDocRunsStatus
Angular (SSR)
baseline/Vercel89(good)0.780.28(needs improvement)3.76(good)33(good)0.0001.033.762413/3OK
baseline/Netlify89(good)0.800.23(needs improvement)3.76(good)32(good)0.0001.183.761193/3OK
baseline/Cloudflare89(good)0.780.56(needs improvement)3.76(good)18(good)0.0001.243.764513/3OK
baseline/10145787Vercel99(good)0.780.19(good)2.10(good)3(good)0.0001.052.281403/3OK
baseline/10145787Netlify99(good)0.780.24(good)1.96(good)0(good)0.0001.081.961753/3OK
baseline/10145787Cloudflare99(good)0.780.28(good)2.11(good)5(good)0.0001.132.332123/3OK
optimized/Vercel87(good)0.781.32(poor)4.06(good)41(good)0.0002.174.062453/3OK
optimized/Netlify85(good)0.792.30(poor)4.06(good)45(good)0.0003.604.061823/3OK
optimized/Cloudflare89(good)0.830.71(needs improvement)3.61(good)20(good)0.0001.733.613963/3OK
optimized/10145787Vercel98(good)0.781.30(good)2.44(good)7(good)0.0002.502.441583/3OK
optimized/10145787Netlify98(good)0.781.25(good)2.41(good)47(good)0.0002.472.411233/3OK
optimized/10145787Cloudflare100(good)0.790.84(good)1.81(good)23(good)0.0001.782.153723/3OK