HTTP/2 & HTTP/3

Multiplexing streams, HPACK/QPACK header compression, server push, QUIC UDP transport, and 0-RTT connection resumption.

Overview

Overview HTTP/2 and HTTP/3 are major protocol revisions designed to address the performance limitations of HTTP/1.1. Understanding them is critical for engineers working on high-performance web services, CDNs, API gateways, and load balancers.

HTTP/2, standardized in RFC 7540, introduced binary framing as a replacement for HTTP/1.1's text-based format. Requests and responses are split into frames, which are multiplexed over a single TCP connection using stream IDs. This eliminates the need for multiple TCP connections to parallelize requests (HTTP/1.1 required 6 parallel connections per origin in browsers). HTTP/2 also introduced HPACK header compression, which significantly reduces header overhead for APIs that send the same headers repeatedly, and server push, which allows the server to proactively send resources the client will need before it asks.

However, HTTP/2 still runs over TCP, which means it inherits TCP's head-of-line blocking at the transport layer. A single lost packet stalls all multiplexed streams until the retransmission arrives. On lossy networks, HTTP/2 can perform worse than HTTP/1.1 with 6 parallel connections because HTTP/1.1's parallel connections are independent TCP streams that do not block each other.

HTTP/3, standardized in RFC 9114, solves this by running over QUIC instead of TCP. QUIC is a UDP-based transport that implements reliable delivery per-stream — a lost packet only stalls the stream it belongs to, not all streams. QUIC also integrates TLS 1.3 natively, reducing connection establishment to 1 RTT (or 0 RTT for resumed connections). Connection migration allows QUIC connections to survive IP address changes (e.g., switching from WiFi to LTE on mobile), which is impossible with TCP-based protocols.

For production systems, HTTP/3 support requires that UDP port 443 is not firewalled, and servers must advertise HTTP/3 availability via the Alt-Svc response header. Clients that cannot use QUIC fall back to HTTP/2 transparently. Major CDNs (Cloudflare, Fastly, Google Cloud) and servers (nginx, Caddy, Envoy) support HTTP/3, making it increasingly relevant for SRE and infrastructure teams.

Key concepts

  • HTTP/2 Streams and Frames
  • HPACK Header Compression
  • QPACK
  • Server Push
  • 0-RTT Connection Resumption
  • Connection Migration

Interview questions

  • How does HTTP/2 multiplexing work, and why does it not fully eliminate head-of-line blocking?
  • What is QUIC and how does HTTP/3 use it? What are the tradeoffs vs HTTP/2?

Sign up free to read the full topic

More Networking topics

Start free on Cariara · Coding problems · System design studio