v148 · html · enabled by default
Out of order streaming
Lets a server update any named region of a streamed HTML document without JavaScript — using processing instruction range markers (<?start id?> / <?end id?>) and <template for="id"> elements that replace matched regions as they arrive in the stream.
at a glance
| Shipped in | Chrome 148 (milestone 148 listing) |
|---|---|
| Status | Enabled by default |
| Flag | None |
| Standards position | Safari: Support (WebKit/standards-positions#628) · Firefox: Positive (mozilla/standards-positions#1369) |
| Spec | whatwg/html PR #11818 (Working draft); HTML Standard — template element |
| Explainer | WICG declarative-partial-updates |
| Blink component | Blink>HTML |
| ChromeStatus | 5111042975465472 — Out of order streaming (API record) |
why it exists
Classic HTTP streaming delivers content top-to-bottom. If a slow database query powers a section at the top of the page, everything below waits. Today, fixing this requires either JavaScript (e.g. fetch + innerHTML) or multiple round-trips. Out of order streaming is a declarative, zero-JS solution: the server streams a placeholder, continues with fast content below, then later streams a <template for="id"> that the browser uses to replace the placeholder — no script involved.
key primitives
<?start id?> | Processing instruction that opens a named streaming region. |
|---|---|
<?end id?> | Processing instruction that closes the named region. |
<template for="id"> | HTML element whose content replaces the matched region when the parser sees it. The for attribute references the region id. |
how it works (examples)
Declarative streaming replaces placeholder ranges in-place as subsequent HTML arrives across the connection:
1. Mark a region with PI range markers
The server emits processing instructions to delimit the region that should be replaced later. These require the Parse processing instructions in HTML feature (also v148).
<!-- Server streams this first -->
<main>
<?start slow-section?>
<p>Loading…</p>
<?end slow-section?>
<p>Fast content rendered immediately.</p>
</main>
2. Stream a replacement template later
When the slow data is ready, the server writes a <template for="slow-section">. The browser replaces the marked region's content with the template's content in-place — no layout disruption, no JS required.
<!-- Server streams this after the slow query completes -->
<template for="slow-section">
<article>
<h2>Top result: Gadget X</h2>
<p>Price: $49 — In stock</p>
</article>
</template>
Result
The user sees "Loading…" for the slow section, while fast content below renders immediately. When the template arrives, the placeholder is replaced without a repaint of unrelated content.
browser support
| Chrome | 148 (desktop; see webstatus.dev template and BCD template) |
|---|---|
| Edge | 148 (Chromium) |
| Firefox | Positive (mozilla/standards-positions#1369) |
| Safari | Support (WebKit/standards-positions#628) |
see also
- whatwg/html PR #11818 — spec draft
- WICG declarative-partial-updates repository
- Parse processing instructions in HTML — prerequisite feature
- Renewed HTML insertion & streaming methods — JS-based companion
- chromestatus: Out of order streaming
- Chromium tracking issue 431374376
- chrome-platform-showcase: demos