HTTP/1.0 and 1.1: The Foundation
HTTP/1.0 was simple but inefficient. Every request required a new TCP connection. The 3-way handshake and slow-start mechanism meant high latency for every asset.
HTTP/1.1 introduced Keep-Alive (persistent connections), allowing multiple requests over a single connection. It also attempted Pipelining (sending multiple requests without waiting for responses), but this failed in practice due to Head-of-Line (HOL) Blocking: if the first response was slow, everyone behind it waited, as responses had to be returned in order.
HTTP/2: Binary Framing and Multiplexing
HTTP/2 (RFC 7540) radically changed the wire format from text to binary. It introduced the Binary Framing Layer, which breaks messages into frames.
- Multiplexing: Multiple request/response streams coexist on one TCP connection. A blocked stream doesn't stop others.
- HPACK: Compresses headers, reducing overhead (crucial for mobile).
- Server Push: The server sends resources before the client asks (though this is being deprecated in favor of Early Hints).
However, HTTP/2 still runs on TCP. If a single TCP packet is lost, the OS holds all streams until retransmission, causing TCP Head-of-Line Blocking.
HTTP/3 and QUIC: UDP Revolution
HTTP/3 runs on QUIC, a transport protocol built over UDP. QUIC handles streams independently at the transport layer.
- No TCP HOL Blocking: Packet loss affects only the specific stream, not the whole connection.
- Connection Migration: Clients can switch networks (Wi-Fi to LTE) without reconnecting, using a Connection ID instead of IP/Port tuples.
- 0-RTT: Faster handshakes combined with TLS 1.3.