HTTP/2 vs HTTP/1.1
One connection, many streams
24 resources, 6 HTTP/1.1 connections, a 100 ms round trip, fast server. Roughly how long until the last response arrives?
HTTP/1.1 carries one request at a time per connection. Browsers open about six connections per origin, and request seven waits in a queue for one of them. A slow response, like an API call that takes 200 ms to compute, ties up its connection the whole time. That is head-of-line blocking at the HTTP layer.
HTTP/2 sends every request at once on one connection. Each is a stream, and responses are cut into frames that interleave on the wire. The server picks which stream’s frame goes next. The catch: all streams share one TCP byte stream, so a lost packet stalls them all.
HTTP/1.1 (RFC 9112)
One request in flight per connection. Pipelining exists but is unused
in browsers, so a slow response occupies its connection until it ends.
Browsers open ~6 connections per origin; request 7 waits in a queue.
HTTP/2 (RFC 9113)
One TCP connection, many streams (client streams use odd ids: 1, 3, 5 …).
Requests and responses are split into frames (HEADERS, DATA, …) that
interleave on the wire. The sender picks which stream's frame goes next,
so a slow response no longer blocks the others at the HTTP layer.
HPACK compresses repeated headers.
Server push (PUSH_PROMISE): deprecated in practice. Chrome removed it in
2022; most servers and CDNs disable it. Use 103 Early Hints / preload.
The RFC 7540 priority tree is deprecated in RFC 9113; RFC 9218
(Extensible Priorities, the "priority" header) replaces it.
What HTTP/2 does NOT fix
TCP delivers bytes in order. One lost segment stalls every stream on the
connection until it is retransmitted: head-of-line blocking moved down a
layer. HTTP/3 runs streams over QUIC, which orders bytes per stream. Watch the invariant strip and the DOWNLINK box. HTTP/1.1 runs out of connections and blows the 4 RTT budget. HTTP/2 meets it with the same page. HTTP/2, NO MULTIPLEXING shows that the win comes from the frame scheduler: write responses in order and the link sits idle behind /api/feed. HTTP/2 + 1 LOST PACKET still meets the budget, but count the streams held back by one lost frame.
HTTP/1.1 with 6 connections. Find the largest RESOURCES count at which the page still loads within the 4 RTT budget, so that one more resource breaks it.
GOAL: HTTP/1.1 meets the budget at RESOURCES but not at RESOURCES + 1
You write the HTTP/2 server's frame scheduler. Each tick it is called with every stream and the id it sent last; return the id of the stream whose next DATA frame goes on the wire, or null if nothing is ready. A stream with ready: false is still waiting on the backend. Never let one stream (slow or large) hold back the others, and never leave the link idle while a ready stream has frames left. Round-robin is one policy that does this; it is not the only one. Real clients can also ask for sequential delivery with RFC 9218 priorities.
Waterfall charts in browser dev tools (the six-wide staircase is HTTP/1.1), domain sharding and sprite sheets (HTTP/1.1 workarounds that hurt under HTTP/2), CDN and load balancer HTTP/2 settings, and HTTP/3 rollouts justified by mobile packet loss.
“What does HTTP/2 improve over HTTP/1.1, and what problem remains?” Cover multiplexing over one connection, binary framing and HPACK, why six connections only divide the round trips, that server push is effectively dead, and that TCP-level head-of-line blocking is why HTTP/3 moved to QUIC.