How it works
Why stream server-rendered HTML out of order
What streaming out of order buys a page, and how other frameworks came to it.
Angular renders a page on the server and sends it whole, so a page is as slow as its slowest request: if the product renders at once, the reviews take one second and the recommendations three, the reader gets a blank page for three seconds. There are two ways to stream instead:
- In order. HTML goes out top to bottom as it is ready. The top of the page arrives early, but a slow part still holds back everything below it.
- Out of order. Everything that is ready goes out at once, with a placeholder for each part that is not. Each part follows when its data arrives, in whatever order that is, and a script puts it in place.
Here is that product page sent all three ways, on one clock. Its recommendations sit above its reviews, and the part that needs no data is ready after a tenth of a second:
Wait for everything
The server renders the whole page, then sends it. Angular’s server rendering works this way.
Blank page
- First content
- 3.0 s
- Reviews
- 3.0 s
Stream in order
HTML goes out top to bottom as it is ready. A slow part holds back everything below it.
Product- First content
- 0.1 s
- Reviews
- 3.0 s
Stream out of order
Everything that is ready goes out at once, with placeholders. Each is filled in when its data arrives.
ProductRecommendationsloadingReviews- First content
- 0.1 s
- Reviews
- 1.0 s
A drawing, not a measurement: the times are made up.
All three finish at the same moment: streaming does not make a slow request faster. What changes is everything else. Sent out of order, the product is on screen after 0.1 seconds and the reviews after 1, where the other two leave the reader with a blank or half-empty page for 3. In order, the reviews are ready after one second and still wait two more, behind the recommendations above them. The browser also gets to start on the styles, fonts and scripts that much sooner.
The idea is about fifteen years old, and each framework that has it gives the same reason:
| When | Who | How a late part is placed | In their words |
|---|---|---|---|
| 2010 | Facebook, BigPipe | A script call sets the placeholder's innerHTML |
"When the web server is busy generating a page, the browser is idle and wasting its cycles doing nothing." |
| 2014 | eBay, Marko | Fragment in a hidden element, a script moves it to its id | Without it, "the user will be staring at a blank screen for a large portion of the time." |
| 2021 | React 18 | Fallback first, then HTML and an inline script that swaps it | "Unlike traditional HTML streaming, it doesn't have to happen in the top-down order." |
| Next.js | React's, per <Suspense> boundary or loading.js |
"A single slow database query or API call can block the entire page." | |
| SvelteKit | Promises returned from a server load are streamed |
"This is useful if you have slow, non-essential data" | |
| Qwik | Experimental, inside <Pending> |
"Out-of-order streaming helps when one section of the page is slow, but the rest of the page is ready." | |
| 2026 | The browser | <template for> fills a <?marker>, with no script |
"primitives that have been part of userland libraries for about a decade" |
Facebook measured the result: "BigPipe reduces user perceived latency by half in most browsers." React named the problem: "You have to fetch everything before you can show anything".
The native version is new: Chrome's intent to ship targets version 150, and Chrome's guide describes it as "shipped in only a single browser engine". This project places late parts with a small inline script, as the libraries do.
Angular itself has no streaming, and its roadmap lists none;
Does Angular support streaming SSR? shows where that
comes from. What it has is
incremental hydration: a @defer block with a hydrate trigger stays as
plain server HTML until the trigger fires. Angular is not touching that markup
yet, which is what lets the server replace it underneath a running application,
and it is the piece everything below builds on. To see the two together, step
through one load of this page in the
Introduction:
the reviews arrive before the recommendations above them, and each part
hydrates on its own.
The costs are the same everywhere, and apply here:
- The status code goes out with the shell. A part that fails later cannot turn the response into an error page or a redirect.
- Placeholders get replaced, so content can shift unless each placeholder holds the room its content will need.
- A late part needs JavaScript to be put in place. With scripts off, the reader keeps the placeholder.
- Streamed responses are not cached as they stand; see When something goes wrong.