Appearance
HTTP/1.1 vs HTTP/2 vs HTTP/3
HTTP/1.1 (1997)
- One request at a time per connection.
- Must wait for response before sending next request.
- Persistent connections — reuses TCP connection (keep-alive) but still sequential.
- Head of Line Blocking (HOL) — one slow request blocks everything behind it.
Request 1 --> wait --> Response 1
Request 2 --> wait --> Response 2 ← can't send until R1 done
Request 3 --> wait --> Response 3 ← can't send until R2 donePipelining (attempted fix)
- Send multiple requests without waiting for responses.
- But responses must come back in order — still HOL blocking.
- Rarely used in practice — many servers/proxies don't support it properly.
Problems with HTTP/1.1
- Verbose text-based headers (repeated every request).
- No compression of headers.
- HOL blocking.
- Multiple TCP connections = resource waste.
Workarounds Developers Used
- Multiple TCP connections (browsers open 6 per domain)
- Domain sharding — split resources across subdomains
- Bundling/minification — reduce number of requests
- Spriting — combine images into one
HTTP/2 (2015)
- Binary Protocol — HTTP/1.1 is text-based → verbose, slower to parse. HTTP/2 is binary → compact, faster to parse.
- Multiplexing ★ — Multiple requests/responses simultaneously over one TCP connection. No HOL blocking at application layer. Each message split into frames sent interleaved.
- Header Compression (HPACK) — Headers compressed using HPACK. Repeated headers (like cookies) sent only once. Significant bandwidth savings.
- Server Push — Server can proactively send resources client hasn't requested yet. E.g. client requests
index.html→ server also pushesstyle.cssandapp.js. - Stream Prioritization — Assign priority to streams. Critical resources (CSS, JS) loaded before images.
HTTP/2 Multiplexing
Stream 1: --> Request A --> Response A
Stream 2: --> Request B --> Response B ← all at same time!
Stream 3: --> Request C --> Response CHTTP/2 Still Uses TCP — Problem
- HTTP/2 solved application-layer HOL blocking.
- But TCP itself has transport-layer HOL blocking.
- One lost packet → entire TCP connection stalls waiting for retransmission.
Packet lost --> TCP waits --> ALL streams stallHTTP/3 (2022)
- Built on QUIC instead of TCP. HTTP/3 runs over QUIC (not TCP). QUIC runs over UDP.
What Is QUIC?
- Developed by Google.
- UDP-based transport protocol.
- Implements reliability, ordering, congestion control itself.
- Built-in TLS 1.3 encryption.
HTTP/3 Key Improvements
1. No HOL Blocking ★
- QUIC handles streams independently.
- Lost packet only affects that stream, not others.
2. Faster Connection Setup
- HTTP/1.1/2 over TLS: TCP handshake (1 RTT) + TLS handshake (1-2 RTT) = 2-3 RTT
- HTTP/3 over QUIC: combines transport + crypto = 1 RTT (or 0-RTT for repeat visits)
3. Connection Migration
- TCP connections tied to IP + Port. Switch networks (WiFi → 4G) → connection breaks.
- QUIC uses Connection ID — not tied to IP/Port. Switch network → connection continues.
4. Built-in Encryption
- TLS 1.3 is mandatory in QUIC. HTTP/3 is always encrypted.
HTTP/2 (TCP): Packet lost → ALL streams stall ✗
HTTP/3 (QUIC): Packet lost → only that stream affected ✓
HTTP/2: Switch network → connection dies → reconnect ✗
HTTP/3: Switch network → connection continues ✓Side by Side Comparison
| Feature | HTTP/1.1 | HTTP/2 | HTTP/3 |
|---|---|---|---|
| Year | 1997 | 2015 | 2022 |
| Protocol | TCP | TCP | QUIC (UDP) |
| Format | Text | Binary | Binary |
| Multiplexing | No | Yes | Yes |
| HOL Blocking | App + Transport | Transport only | None |
| Header Compression | No | HPACK | QPACK |
| Server Push | No | Yes | Yes |
| Connection Setup | 2-3 RTT | 2-3 RTT | 1 RTT / 0-RTT |
| Encryption | Optional | Optional | Mandatory |
| Connection Migration | No | No | Yes |
HOL Blocking Evolution
HTTP/1.1: [R1]--[R2]--[R3] sequential, fully blocked
HTTP/2: [R1] --------------> multiplexed BUT
[R2] --------------> one TCP packet loss
[R3] --------------> stalls ALL streams
HTTP/3: [R1] --------------> truly independent
[R2] --------------> one packet loss
[R3] --------------> only affects that streamQuick Analogy
| Version | Analogy |
|---|---|
| HTTP/1.1 | Single checkout lane — one customer at a time |
| HTTP/2 | Multiple lanes but same road — if road blocks, all lanes stop |
| HTTP/3 | Multiple independent roads — one blocked road doesn't affect others |