HTTP/2 & HTTP/3 Multiplexing
HTTP/2 interleaves binary frames from dozens of requests over a single TCP connection, eliminating application-level head-of-line blocking. HTTP/3 replaces TCP with QUIC over UDP so a single dropped packet stalls only its own stream rather than freezing every asset in flight.
Connection Strategy: HTTP/1.1 Sharding vs HTTP/3 QUIC
Compare legacy domain-sharded HTTP/1.1 pools against single-origin QUIC stream multiplexing.
// Legacy bundling & sharding workaround
<script src="https://static1.cdn.example/app.js"></script>
<link rel="stylesheet" href="https://static2.cdn.example/app.css" />
// Separate TLS handshakes + 6-socket cap per hostEach stalled request blocks every queued asset behind it on that socket.
// Single origin with Alt-Svc: h3=":443"; ma=86400
<script type="module" src="/assets/app.js"></script>
<link rel="stylesheet" href="/assets/app.css" />
// Independent QUIC streams over 1-RTT UDPA lost UDP packet only stalls its own stream; sibling CSS and JS continue arriving.
Under the Hood
HTTP/1.1 behaves like a single-lane tollbooth: six parallel TCP connections per origin, each waiting for one response to finish before starting the next. HTTP/2 turns that tollbooth into a multi-lane highway where the network stack interleaves numbered binary frames from CSS, JS, and images discovered by the Preload Scanner.
- On connection setup, the client and server negotiate
h2via ALPN over TLS orh3viaAlt-Svcover QUIC. - Each HTTP request allocates a unique numeric stream ID and encodes headers through HPACK (HTTP/2) or QPACK (HTTP/3).
- Under HTTP/2, the OS kernel still delivers one ordered TCP byte stream, so a single lost packet blocks all streams until retransmission completes.
- Under HTTP/3, QUIC manages stream reassembly in user space per stream, keeping the Browser Rendering Pipeline fed with unblocked CSS and script chunks.
HTTP/2 200
alt-svc: h3=":443"; ma=86400
priority: u=1, i
content-type: text/css; charset=utf-8
cache-control: public, max-age=31536000, immutableProblem Genealogy
- 1999 (HTTP/1.1 Pipelining): Allowed queued requests on one socket, but responses still arrived strictly in FIFO order; proxies routinely broke it.
- 2015 (RFC 7540 HTTP/2): Introduced binary framing and HPACK compression, killing domain sharding, though TCP still stalled every stream on 1% packet loss.
- 2022 (RFC 9114 HTTP/3): Moved transport to QUIC over UDP, finally burying the "just open six sockets to
static4.example.com" era.
Production Pitfalls
- Legacy domain sharding: Splitting bundles across
cdn1andcdn2forces extra TLS handshakes and breaks stream prioritization across assets. - Corporate UDP blocks: Roughly 3–5% of enterprise firewalls drop UDP port 443; servers must keep HTTP/2 over TCP active as an automatic fallback.
- When not to use HTTP/3: On internal microservice meshes or low-loss fiber links where kernel TCP offload outperforms user-space QUIC CPU overhead.
Connections & Logical Next Steps
Compressed streams reduce frame count and header overhead across multiplexed connections.
Browsers only honor 103 informational responses over HTTP/2 or HTTP/3.
Conditional 304 revalidations travel as lightweight header frames over multiplexed streams.
Chunked DATA frames stream progressively over a single multiplexed connection.
The preload scanner queues concurrent asset fetches that rely on multiplexed streams.
Stream prioritization determines whether CSS and fonts arrive before render-blocking frames.