# angular-ssr-stream > Streaming server-side rendering (SSR) for Angular. The server sends a page's shell at once and streams each slow part into the same response as its data arrives. The browser hydrates the page while the response is still open, and nothing is fetched twice. - Angular has no streaming SSR of its own: `renderApplication()` and `@angular/ssr` send a page whole, once the application is stable. angular-ssr-stream is a library that adds out-of-order streaming on top of Angular's incremental hydration. It is a community project by PushBased, not affiliated with or endorsed by Google or the Angular team. - A part of a page streams when it is a `@defer` block with a `hydrate` trigger, placed directly inside an element, with its data loaded through `HttpClient` or a resource (`httpResource()`, `resource()`). `hydrate when ` is the trigger to prefer. Everything outside such a block is the shell, which is sent once. - An app needs two things: `provideStreamHydration()` and `streamHttpInterceptor` in its browser config, and a server entry. The server entry is `createStreamingHandler()` from `@push-based/angular-ssr-stream-core/server` on a runtime that speaks web `Request` and `Response`, or the adapter package for its runtime. - It supports a narrow range of Angular versions, named on the Installation page, and needs the app to be standalone and zoneless. It does not use `@angular/ssr`: `AngularAppEngine`, server routes and per-route render modes are not available. - Streaming does not make a slow request faster. It stops the rest of the page from waiting for it. The status code is sent with the shell, and a streamed response is not cached. Source: https://github.com/push-based/angular-ssr-stream Live demo: https://angular-ssr-stream-demo.chris-holder.workers.dev/ ## Getting started What it is, what it needs, and which packages to install. - [Introduction](https://push-based.github.io/angular-ssr-stream/docs/getting-started/introduction): What streamed hydration is: one response, sent in pieces, hydrated while it is still arriving. - [Installation](https://push-based.github.io/angular-ssr-stream/docs/getting-started/installation): The packages, what they need, and how to install them. ## Runtimes One setup page per server or platform. You need only yours. - [Angular CLI](https://push-based.github.io/angular-ssr-stream/docs/getting-started/angular-cli): Stream the server-rendered routes of an app made by ng new --ssr, built by ng build and served by @angular/ssr. - [Node](https://push-based.github.io/angular-ssr-stream/docs/getting-started/node): Stream an Angular app from Node with node:http, Express or Connect, from the app config to running it in production. - [Express](https://push-based.github.io/angular-ssr-stream/docs/getting-started/express): Stream an Angular app from Express 5, next to your API routes and behind compression, from the app config to production. - [Fastify](https://push-based.github.io/angular-ssr-stream/docs/getting-started/fastify): Stream an Angular app from a Fastify plugin, next to your routes, with @fastify/static and @fastify/compress. - [NestJS](https://push-based.github.io/angular-ssr-stream/docs/getting-started/nestjs): Stream an Angular app from a NestJS app on platform-express or platform-fastify, next to its controllers, from the app config to running it in production. - [Koa](https://push-based.github.io/angular-ssr-stream/docs/getting-started/koa): Stream an Angular app from Koa, with koa-static, koa-compress and your API routes, from the app config to running it in production. - [Cloudflare Workers](https://push-based.github.io/angular-ssr-stream/docs/getting-started/cloudflare-workers): Stream an Angular app from a Cloudflare Worker, from the app config to the deploy. - [Hono](https://push-based.github.io/angular-ssr-stream/docs/getting-started/hono): Stream an Angular app from Hono on Node, Bun, Deno or Cloudflare Workers, next to your API routes. - [Deno](https://push-based.github.io/angular-ssr-stream/docs/getting-started/deno): Stream an Angular app from Deno with Deno.serve, deploy it to Deno Deploy, and what Supabase Edge Functions allow. - [Bun](https://push-based.github.io/angular-ssr-stream/docs/getting-started/bun): Stream an Angular app from Bun.serve(), or from Elysia, from the app config to production. - [Fastly Compute](https://push-based.github.io/angular-ssr-stream/docs/getting-started/fastly-compute): Stream an Angular app from Fastly Compute, with its files in a KV Store, from the app config to the deploy. - [Vercel](https://push-based.github.io/angular-ssr-stream/docs/getting-started/vercel): Stream an Angular app from a Vercel Function, from the app config to the Build Output Vercel deploys. - [Netlify](https://push-based.github.io/angular-ssr-stream/docs/getting-started/netlify): Stream an Angular app from a Netlify Function or an Edge Function, from the app config to the deploy. - [AWS Lambda](https://push-based.github.io/angular-ssr-stream/docs/getting-started/aws-lambda): Stream an Angular app from AWS Lambda through a streaming Function URL and CloudFront. - [Azure Functions](https://push-based.github.io/angular-ssr-stream/docs/getting-started/azure-functions): Stream an Angular app from Azure Functions, from the app config to the deploy. - [Nitro](https://push-based.github.io/angular-ssr-stream/docs/getting-started/nitro): Stream an Angular app from a Nitro server, deployed with any of its presets: Node, Vercel, Netlify and more. ## Guides Making a page stream, checking that it does, getting it through a proxy, and running it in production. - [Making something stream](https://push-based.github.io/angular-ssr-stream/docs/guides/making-something-stream): Which parts of a template stream, which hydrate trigger to pick, and what to expect from them. - [React Suspense streaming, in Angular](https://push-based.github.io/angular-ssr-stream/docs/guides/coming-from-react-suspense): A Suspense boundary, its fallback and loading.js: what each maps to here, and where streaming an Angular page differs from streaming a React one. - [Analog's streaming SSR, compared](https://push-based.github.io/angular-ssr-stream/docs/guides/analog-streaming-ssr): One page sent through both, step by step: when each part can be read and clicked, what is better here, and what Analog does that this library does not. - [Troubleshooting](https://push-based.github.io/angular-ssr-stream/docs/guides/debugging): What you see when a page does not stream or hydrate, how to confirm the cause, and what to change. - [Streaming through proxies](https://push-based.github.io/angular-ssr-stream/docs/guides/streaming-through-proxies): Compression, Nginx, CDNs and timeouts: what holds a streamed response back, and how to check that it does not. - [Going to production](https://push-based.github.io/angular-ssr-stream/docs/guides/production): Status codes, crawlers and metadata, Content Security Policy, caching, Web Vitals and request context, with a checklist. - [Service Worker (experimental)](https://push-based.github.io/angular-ssr-stream/docs/guides/service-worker): Render and stream every navigation from a Service Worker in the browser, offline included, and what that costs. ## How it works What Angular has and what it lacks, why stream out of order, what goes over the wire, and what does not work yet. - [Does Angular support streaming SSR?](https://push-based.github.io/angular-ssr-stream/docs/concepts/angular-streaming-ssr): No: Angular sends a server-rendered page whole. Why it can look as if it streamed, what it has instead, and how to add streaming to it. - [Why stream out of order](https://push-based.github.io/angular-ssr-stream/docs/concepts/why-stream-out-of-order): What streaming out of order buys a page, and how other frameworks came to it. - [One response, flush by flush](https://push-based.github.io/angular-ssr-stream/docs/concepts/walkthrough): A real response taken apart: the HTML each flush carries, and when each part hydrates. - [Wire format and internals](https://push-based.github.io/angular-ssr-stream/docs/concepts/internals): The chunk format, what the server does on each flush, and what the browser does with it. - [Caveats and limitations](https://push-based.github.io/angular-ssr-stream/docs/reference/limitations): What does not work yet, and why. ## API reference Every export of every package, in the order of the runtimes. - [angular-ssr-stream-core](https://push-based.github.io/angular-ssr-stream/docs/reference/core): The API of @push-based/angular-ssr-stream-core: the client providers and the runtime-agnostic server handler. - [angular-ssr-stream-angular-ssr](https://push-based.github.io/angular-ssr-stream/docs/reference/angular-ssr): The API of @push-based/angular-ssr-stream-angular-ssr: streaming for @angular/ssr, and the renderer main.server.ts exports. - [angular-ssr-stream-node](https://push-based.github.io/angular-ssr-stream/docs/reference/node): The API of @push-based/angular-ssr-stream-node: a Node request handler, the pieces it is made of, and a Vite plugin for dev. - [angular-ssr-stream-fastify](https://push-based.github.io/angular-ssr-stream/docs/reference/fastify): The API of @push-based/angular-ssr-stream-fastify: a Fastify plugin that streams every page route. - [angular-ssr-stream-nestjs](https://push-based.github.io/angular-ssr-stream/docs/reference/nestjs): The API of @push-based/angular-ssr-stream-nestjs: a Nest module that renders every page route, and a Vite plugin for dev. - [angular-ssr-stream-cloudflare](https://push-based.github.io/angular-ssr-stream/docs/reference/cloudflare): The API of @push-based/angular-ssr-stream-cloudflare: a Worker fetch handler over the ASSETS binding. - [angular-ssr-stream-aws-lambda](https://push-based.github.io/angular-ssr-stream/docs/reference/aws-lambda): The API of @push-based/angular-ssr-stream-aws-lambda: a response-streaming handler for a Lambda Function URL. - [angular-ssr-stream-nitro](https://push-based.github.io/angular-ssr-stream/docs/reference/nitro): The API of @push-based/angular-ssr-stream-nitro: an h3 handler, and a Vite plugin that gives it the template. ## About Questions, releases and the logo. - [FAQ](https://push-based.github.io/angular-ssr-stream/docs/reference/faq): Short answers on Angular support, SEO, caching, the Angular CLI, failures and readiness, each linking the page with the long one. - [Releases and upgrading](https://push-based.github.io/angular-ssr-stream/docs/reference/releases): How the packages are versioned and tagged, where the release notes are, and how to upgrade Angular and the packages. - [Press kit](https://push-based.github.io/angular-ssr-stream/docs/reference/press-kit): The angular-ssr-stream logo: the files, the colours and how to use them.