# Analog

Analog scores 17 of 28 points on 14 speed features: 8/14 on first-paint levers and 9/14 on other features. Rank 8 of 23, tied with TanStack Start (React), TanStack Start (Solid), Waku, Void (Svelte). Labels: 7 1st-party, 1 Experimental, 2 Third-party, 4 Manual.

- Version checked: @analogjs/platform 3.0.0 (npm latest on 2026-11-25; analogjs.org documents v3) (The Books port (analog-books) runs it with Angular 22.3 and Nitro 2.14.)
- Performance guide: [Static Site Generation | Analog](https://analogjs.org/docs/features/server/static-site-generation)
- Issue tracker: https://github.com/analogjs/analog/issues
- Books demo port: [analog-books](https://github.com/MaxwellCohen/analog-books)

## Summary

| Feature | Group | Label | Points |
| --- | --- | --- | --- |
| [Production CSS inlining](https://framework-compare.vercel.app/features/css-inlining.md) | First-paint levers | Manual | 0 |
| [Font optimization](https://framework-compare.vercel.app/features/font-optimization.md) | First-paint levers | Third-party | 1 |
| [Image pipeline](https://framework-compare.vercel.app/features/image-pipeline.md) | First-paint levers | 1st-party | 2 |
| [Data/HTML caching](https://framework-compare.vercel.app/features/caching.md) | First-paint levers | 1st-party | 2 |
| [Route prefetching](https://framework-compare.vercel.app/features/route-prefetching.md) | First-paint levers | 1st-party | 2 |
| [Streaming SSR](https://framework-compare.vercel.app/features/streaming-ssr.md) | First-paint levers | Experimental | 1 |
| [Early Hints / preload headers](https://framework-compare.vercel.app/features/early-hints.md) | First-paint levers | Manual | 0 |
| [Islands / partial hydration / lazy slices](https://framework-compare.vercel.app/features/islands.md) | Other features | 1st-party | 2 |
| [Per-route render modes](https://framework-compare.vercel.app/features/render-modes.md) | Other features | 1st-party | 2 |
| [Fine-grained client reactivity](https://framework-compare.vercel.app/features/reactivity.md) | Other features | 1st-party | 2 |
| [Built-in bundle analysis](https://framework-compare.vercel.app/features/bundle-analysis.md) | Other features | Third-party | 1 |
| [Third-party script strategies](https://framework-compare.vercel.app/features/third-party-scripts.md) | Other features | Manual | 0 |
| [Portable multi-host deployment](https://framework-compare.vercel.app/features/multi-host-deployment.md) | Other features | 1st-party | 2 |
| [Service worker / offline support](https://framework-compare.vercel.app/features/service-worker.md) | Other features | Manual | 0 |

## First-paint levers

### Production CSS inlining

Label: **Manual** (0 of 2 points).

No first-party CSS inlining documented. Analog builds with Vite and its `index.html` links `src/styles.css`; Angular CLI's `inlineCritical` is an `angular.json` build option and is not listed among the `analog()` options. Inline by hand. ([style-pipeline](https://analogjs.org/docs/guides/style-pipeline), [migrating](https://analogjs.org/docs/guides/migrating))

Example of building it yourself:

Analog has no inlining option, so inline the above-the-fold rules in `index.html` yourself and load the full stylesheet without blocking render.

```html
<!-- index.html -->
<head>
  <base href="/" />
  <!-- hand-picked rules for the header and first row of cards -->
  <style>
    body { margin: 0; font-family: system-ui, sans-serif; }
    .site-header { height: 56px; display: flex; align-items: center; }
  </style>
  <!-- the rest loads async: applied once it arrives -->
  <link rel="stylesheet" href="/src/styles.css" media="print" onload="this.media='all'" />
  <noscript><link rel="stylesheet" href="/src/styles.css" /></noscript>
</head>
```

Source: [Analog: Migrating an Angular app](https://analogjs.org/docs/guides/migrating)

### Font optimization

Label: **Third-party** (1 of 2 points).

No first-party font handling documented; the style pipeline guide covers stylesheet preprocessing only. The third-party route is [Fontsource](https://fontsource.org) packages imported from the global stylesheet. ([style-pipeline](https://analogjs.org/docs/guides/style-pipeline))

Example of building it yourself:

Install a Fontsource package and import it from the global stylesheet. Vite bundles the font files with hashed names and serves them from your own origin.

```css
/* src/styles.css (npm install @fontsource-variable/open-sans) */
@import '@fontsource-variable/open-sans';

body {
  font-family: 'Open Sans Variable', sans-serif;
}
```

Source: [Fontsource: Install](https://fontsource.org/docs/getting-started/install)

### Image pipeline

Label: **1st-party** (2 of 2 points).

Angular's `NgOptimizedImage` from `@angular/common`, a required dependency of every Analog app: `ngSrc`, `priority`, automatic `srcset`, lazy loading, and loaders for Cloudflare, Cloudinary, ImageKit, Imgix and Netlify. It is an Angular-team package, and the Analog docs do not cover images. ([image-optimization](https://angular.dev/guide/image-optimization))

Example of building it yourself:

Import `NgOptimizedImage` from `@angular/common` and use `ngSrc`. Width and height are required, `priority` marks the LCP image, and a loader provider builds CDN URLs.

```ts
// src/app/pages/index.page.ts
import { Component } from '@angular/core';
import { NgOptimizedImage } from '@angular/common';

@Component({
  imports: [NgOptimizedImage],
  template: `
    <img ngSrc="covers/dune.jpg" width="400" height="600" priority />
    <img ngSrc="covers/emma.jpg" ngSrcset="200w, 400w" sizes="50vw" width="400" height="600" />
  `,
})
export default class HomePage {}

// src/app/app.config.ts
// providers: [provideImgixLoader('https://books.imgix.net/'), /* … */]
```

Source: [Angular: Image optimization](https://angular.dev/guide/image-optimization)

Art direction with `<picture>` (Manual, not scored):

The `NgOptimizedImage` page says `<picture>` is not supported yet; hand-write the markup. ([image-optimization](https://angular.dev/guide/image-optimization))

NgOptimizedImage can't render `<picture>`, so write the element in a page template with plain `<source>` tags. Files in `public/` are served from the site root.

```ts
// src/app/pages/index.page.ts
import { Component } from '@angular/core';

@Component({
  selector: 'app-home',
  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" />
      <source type="image/avif" sizes="100vw"
              srcset="/media/hero-1280.avif 1280w, /media/hero-1920.avif 1920w" />
      <img src="/media/hero-1280.jpg" alt="Shelves of books" width="1280" height="720"
           fetchpriority="high" decoding="async" />
    </picture>
  `,
})
export default class HomePage {}
```

Source: [Angular image optimization FAQ](https://angular.dev/guide/image-optimization)

### Data/HTML caching

Label: **1st-party** (2 of 2 points).

`analog({ prerender: { routes } })` renders listed routes to static HTML at build time, `static: true` builds a server-less site, and prerendered server-side data is written as static files. Response headers are set with h3 `setResponseHeader` in middleware or API routes. No ISR or revalidate option documented. ([static-site-generation](https://analogjs.org/docs/features/server/static-site-generation), [middleware](https://analogjs.org/docs/features/routing/middleware))

Example of building it yourself:

List routes under `prerender.routes` to build them as static HTML. Set `staticData: true` on a route to write its server-side data to static files too. Dynamic responses get headers from server middleware.

```ts
// vite.config.ts
import analog from '@analogjs/platform';
import { defineConfig } from 'vite';

export default defineConfig(() => ({
  plugins: [
    analog({
      prerender: {
        routes: async () => ['/', '/about', { route: '/books', staticData: true }],
      },
    }),
  ],
}));
```

```ts
// src/server/middleware/cache.ts
import { defineEventHandler, setResponseHeader } from 'h3';

export default defineEventHandler((event) => {
  if (event.path.startsWith('/books/')) {
    setResponseHeader(event, 'Cache-Control', 'public, s-maxage=60, stale-while-revalidate=300');
  }
});
```

Source: [Analog: Static site generation](https://analogjs.org/docs/features/server/static-site-generation), [Analog: Middleware](https://analogjs.org/docs/features/routing/middleware)

### Route prefetching

Label: **1st-party** (2 of 2 points).

Angular Router preloading: pass `withPreloading(PreloadAllModules)` to `provideFileRouter(...)`, which accepts Angular router features, to preload lazy route chunks. The Analog docs show other router features there (`withComponentInputBinding`, `withNavigationErrorHandler`) and no preloading example. No link hover or viewport prefetch documented. ([routing](https://analogjs.org/docs/features/routing/overview), [PreloadAllModules](https://angular.dev/api/router/PreloadAllModules))

Example of building it yourself:

`provideFileRouter()` takes Angular router features. `withPreloading(PreloadAllModules)` loads every lazy page chunk after the app starts.

```ts
// src/app/app.config.ts
import { ApplicationConfig } from '@angular/core';
import { provideFileRouter } from '@analogjs/router';
import { PreloadAllModules, withComponentInputBinding, withPreloading } from '@angular/router';

export const appConfig: ApplicationConfig = {
  providers: [
    provideFileRouter(withComponentInputBinding(), withPreloading(PreloadAllModules)),
    // …
  ],
};
```

Source: [Analog: Routing](https://analogjs.org/docs/features/routing/overview), [Angular: PreloadAllModules](https://angular.dev/api/router/PreloadAllModules)

### Streaming SSR

Label: **Experimental** (1 of 2 points).

The streaming SSR page says it "is experimental and opt-in". Set `analog({ experimental: { streaming: true } })` in the Vite config and export `renderStream(AppComponent, config)` from `@analogjs/router/server` in `main.server.ts`; it needs Angular 21+ and Vite 6+, and builds on incremental hydration (`@defer` blocks). The default SSR path stays buffered. ([streaming-ssr](https://analogjs.org/docs/features/server/streaming-ssr))

Example of building it yourself:

Turn on the experimental flag and export `renderStream` from the server entry. It needs Angular 21+ and Vite 6+.

```ts
// vite.config.ts
import analog from '@analogjs/platform';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [analog({ experimental: { streaming: true } })],
});

// src/main.server.ts
import { renderStream } from '@analogjs/router/server';
import { config } from './app/app.config.server';
import { AppComponent } from './app/app.component';

export default renderStream(AppComponent, config);
```

Source: [Analog: Streaming SSR](https://analogjs.org/docs/features/server/streaming-ssr)

### Early Hints / preload headers

Label: **Manual** (0 of 2 points).

No first-party preload `Link` headers or 103 Early Hints documented. Set a `Link` header by hand with h3 `setResponseHeader` in server middleware. ([middleware](https://analogjs.org/docs/features/routing/middleware))

Example of building it yourself:

Set a `Link` header by hand in server middleware. Files in `src/server/middleware/` are registered automatically.

```ts
// src/server/middleware/preload.ts
import { defineEventHandler, setResponseHeader } from 'h3';

export default defineEventHandler((event) => {
  if (event.path.startsWith('/api')) return;
  setResponseHeader(
    event,
    'Link',
    '<https://fonts.gstatic.com>; rel=preconnect; crossorigin, </media/hero-1280.avif>; rel=preload; as=image',
  );
});
```

Source: [Analog: Middleware](https://analogjs.org/docs/features/routing/middleware)

## Other features

### Islands / partial hydration / lazy slices

Label: **1st-party** (2 of 2 points).

Angular incremental hydration: `@defer (hydrate on viewport | idle | interaction | immediate)` blocks, enabled with `provideClientHydration(withIncrementalHydration())` on Angular 21 and by default on Angular 22. Analog's streaming SSR page builds on it; streaming itself is experimental (`experimental.streaming`). ([streaming-ssr](https://analogjs.org/docs/features/server/streaming-ssr), [incremental-hydration](https://angular.dev/guide/incremental-hydration))

Example of building it yourself:

Enable incremental hydration, then wrap a part of the page in `@defer` with a `hydrate` trigger. It renders on the server and hydrates when it scrolls into view.

```ts
// src/app/app.config.ts (Angular 21; on by default with provideClientHydration() from Angular 22)
import { provideClientHydration, withIncrementalHydration } from '@angular/platform-browser';
// providers: [provideClientHydration(withIncrementalHydration()), /* … */]

// src/app/pages/books/[id].page.ts
import { Component, signal } from '@angular/core';
import { Reviews } from '../../reviews/reviews';

@Component({
  imports: [Reviews],
  template: `
    <h1>{{ title() }}</h1>
    @defer (hydrate on viewport) {
      <app-reviews />
    } @placeholder {
      <div>Reviews</div>
    }
  `,
})
export default class BookPage {
  protected title = signal('Dune');
}
```

Source: [Angular: Incremental hydration](https://angular.dev/guide/incremental-hydration), [Analog: Streaming SSR](https://analogjs.org/docs/features/server/streaming-ssr)

### Per-route render modes

Label: **1st-party** (2 of 2 points).

SSR is the default; `routeRules: { '/admin/**': { ssr: false } }` in the Nitro config renders matching routes on the client only, and `prerender.routes` lists the routes built as static HTML. ([server-side-rendering](https://analogjs.org/docs/features/server/server-side-rendering), [static-site-generation](https://analogjs.org/docs/features/server/static-site-generation))

Example of building it yourself:

Pages render on the server by default. `routeRules` in the Nitro plugin makes matching routes client-only, and `prerender.routes` builds the listed routes as static HTML.

```ts
// vite.config.ts
import analog from '@analogjs/platform';
import angular from '@analogjs/vite-plugin-angular';
import nitro from '@analogjs/vite-plugin-nitro';
import { defineConfig } from 'vite';

export default defineConfig(() => ({
  plugins: [
    analog({ prerender: { routes: ['/', '/about'] } }), // static HTML
    angular(),
    nitro({
      routeRules: {
        '/admin/**': { ssr: false }, // client-only
      },
    }),
  ],
}));
```

Source: [Analog: Server-side rendering](https://analogjs.org/docs/features/server/server-side-rendering)

### Fine-grained client reactivity

Label: **1st-party** (2 of 2 points).

Angular signals (`signal`, `computed`, `resource`); Analog's own `injectServerFn` returns an Angular `resource` that refetches when a signal it reads changes. Zoneless change detection is the default from Angular 21. ([server-functions](https://analogjs.org/docs/features/data-fetching/server-functions), [signals](https://angular.dev/guide/signals))

Example of building it yourself:

A signal holds the search text. `injectServerFn` returns an Angular resource that refetches when a signal read in its args factory changes.

```ts
// src/app/pages/search.page.ts
import { Component, computed, signal } from '@angular/core';
import { injectServerFn } from '@analogjs/router';
import { searchBooks } from '../server-fns/books.server';

@Component({
  template: `
    <input [value]="query()" (input)="query.set($any($event.target).value)" />
    <p>{{ count() }} results</p>
    @for (book of books.value() ?? []; track book.id) {
      <p>{{ book.title }}</p>
    }
  `,
})
export default class SearchPage {
  query = signal('');
  protected books = injectServerFn(searchBooks, () => ({ q: this.query() }));
  count = computed(() => this.books.value()?.length ?? 0);
}
```

Source: [Analog: Server functions](https://analogjs.org/docs/features/data-fetching/server-functions), [Angular: Signals](https://angular.dev/guide/signals)

### Built-in bundle analysis

Label: **Third-party** (1 of 2 points).

No first-party analyzer documented; Analog builds with Vite, so the third-party route is a community visualizer such as [rollup-plugin-visualizer](https://github.com/btd/rollup-plugin-visualizer). ([deployment](https://analogjs.org/docs/features/deployment/overview))

Example of building it yourself:

Add `rollup-plugin-visualizer` to the Vite config. `vite build` then writes a treemap of the client bundle.

```ts
// vite.config.ts (npm install -D rollup-plugin-visualizer)
import analog from '@analogjs/platform';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';

export default defineConfig(() => ({
  plugins: [
    analog(),
    visualizer({ filename: 'stats.html', gzipSize: true, template: 'treemap' }),
  ],
}));
```

Source: [rollup-plugin-visualizer](https://github.com/btd/rollup-plugin-visualizer)

### Third-party script strategies

Label: **Manual** (0 of 2 points).

No first-party script-loading primitive documented in the Analog docs. ([server-side-rendering](https://analogjs.org/docs/features/server/server-side-rendering))

Example of building it yourself:

Write the loading strategy yourself: `async` in `index.html` for early scripts, or `afterNextRender` to inject one in the browser after the first render.

```ts
// 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.component.ts: load a chat widget only in the browser
import { Component, afterNextRender } from '@angular/core';
import { RouterOutlet } from '@angular/router';

@Component({ selector: 'app-root', imports: [RouterOutlet], template: '<router-outlet />' })
export class AppComponent {
  constructor() {
    afterNextRender(() => {
      const s = document.createElement('script');
      s.src = 'https://widget.example.com/chat.js';
      s.async = true;
      document.body.append(s);
    });
  }
}
```

Source: [Angular: afterNextRender](https://angular.dev/api/core/afterNextRender)

### Portable multi-host deployment

Label: **1st-party** (2 of 2 points).

Nitro presets ship inside Analog's own `@analogjs/vite-plugin-nitro`. Node is the default output, Vercel and Netlify deploy "with no additional configuration", and Cloudflare Pages needs `BUILD_PRESET=cloudflare-pages`. ([deployment](https://analogjs.org/docs/features/deployment/overview), [providers](https://analogjs.org/docs/features/deployment/providers), [vite-plugin-nitro](https://analogjs.org/docs/packages/vite-plugin-nitro/overview))

Example of building it yourself:

Analog builds a Node server by default. Pick another Nitro preset in the Nitro plugin, or with `BUILD_PRESET` at build time.

```ts
// vite.config.ts
import analog from '@analogjs/platform';
import angular from '@analogjs/vite-plugin-angular';
import nitro from '@analogjs/vite-plugin-nitro';
import { defineConfig } from 'vite';

export default defineConfig(() => ({
  plugins: [analog(), angular(), nitro({ preset: 'vercel' })],
}));
```

```sh
# Node (default): node dist/analog/server/index.mjs
BUILD_PRESET=cloudflare-pages npm run build
npx wrangler pages dev ./dist/analog/public
```

Source: [Analog: Deployment providers](https://analogjs.org/docs/features/deployment/providers)

### Service worker / offline support

Label: **Manual** (0 of 2 points).

No service worker support documented in the Analog docs. Angular's `ng add @angular/pwa` "enables service worker build support in the CLI", and Analog replaces the Angular CLI build with Vite, so the `ngsw.json` asset manifest is not generated for you. Hand-write the worker and register it. ([angular service workers](https://angular.dev/ecosystem/service-workers/getting-started), [migrating](https://analogjs.org/docs/guides/migrating))

Example of building it yourself:

Put a hand-written worker in `public/` and register it with an inline script in `index.html`.

```js
// public/sw.js
const CACHE = 'books-v1'; // change the name on each deploy

self.addEventListener('activate', (event) => {
  event.waitUntil(
    caches.keys().then((keys) => Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))),
  );
});

self.addEventListener('fetch', (event) => {
  const { request } = event;
  if (request.method !== 'GET' || new URL(request.url).origin !== location.origin) return;
  // Network first, so pages stay current. The cached copy answers when offline.
  event.respondWith(
    fetch(request)
      .then((response) => {
        const copy = response.clone();
        caches.open(CACHE).then((cache) => cache.put(request, copy));
        return response;
      })
      .catch(() => caches.match(request)),
  );
});
```

```html
<!-- index.html, before </head> -->
<script>
  if ('serviceWorker' in navigator) {
    addEventListener('load', () => navigator.serviceWorker.register('/sw.js'));
  }
</script>
```

Source: [Using Service Workers (MDN)](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers)

## Other performance features

- A server function read resolved during SSR is transferred to the client, so the browser does not refetch it on hydration. ([server-functions](https://analogjs.org/docs/features/data-fetching/server-functions))
- Automatic `sitemap.xml` for prerendered pages, and prerendering of Markdown pages from a content directory. ([static-site-generation](https://analogjs.org/docs/features/server/static-site-generation))

## Deployments of the Books demo

| Branch | Note | Vercel | Netlify | Cloudflare |
| --- | --- | --- | --- | --- |
| `main` | baseline | https://analog-books.vercel.app | https://analog-books.netlify.app | https://analog-books.to-email-max.workers.dev |
| `optimized` | Nitro route rules + cached functions + NgOptimizedImage + preloading + fonts | https://analog-books-optimized.vercel.app | https://analog-books-max-optimized.netlify.app | https://analog-books-optimized.to-email-max.workers.dev |

## Benchmark, 2026-11-28

Tool: PageSpeed Insights v5 (Lighthouse lab run), mobile strategy. 3 measured runs per deployment, median reported; cold runs are left out of the median when a warm run exists. Each build's figure is the average of its hosts' medians (vercel, netlify, cloudflare). Pages measured: book list (/) and one book (/10145787). Times are lab values from one run on 2026-11-28. FCP is the Lighthouse estimate for simulated Slow 4G; Raw FCP, where shown, is the first paint in the real, unthrottled load that estimate is built from. Builds in the same FCP band (https://framework-compare.vercel.app/measured.md) are a tie, so read "fastest first" as band order.

| Page | Build | Branch | Hosts | Performance | FCP | Raw FCP | LCP | TBT | CLS |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| book list (/) | baseline | `main` | cloudflare, netlify, vercel | 83 | 1.51 s | 1.53 s | 4.36 s | 40 ms | 0.000 |
| book list (/) | optimized | `optimized` | cloudflare, netlify, vercel | 88 | 0.91 s | 0.97 s | 3.90 s | 82 ms | 0.001 |
| one book (/10145787) | baseline | `main` | cloudflare, netlify, vercel | 95 | 1.51 s | 1.12 s | 2.77 s | 44 ms | 0.000 |
| one book (/10145787) | optimized | `optimized` | cloudflare, netlify, vercel | 99 | 0.91 s | 0.63 s | 1.94 s | 18 ms | 0.000 |

Full run: https://framework-compare.vercel.app/benchmark.md

---

HTML version: https://framework-compare.vercel.app/frameworks/analog · All pages: https://framework-compare.vercel.app/llms.txt · Data: https://framework-compare.vercel.app/api/index.json
