HTTP/1.1 vs HTTP/2 vs HTTP/3 Explained
On this page
Fast on office Wi-Fi, slow on the train
A React app feels quick in the office and sluggish on mobile, yet server logs show identical response times. The page loads 40 resources and makes a dozen API calls over one HTTP/2 connection. On a lossy mobile network, every lost packet briefly freezes all of them at once. The version of HTTP in use explains it, and changing it is a configuration switch.
HTTP/1.1: one request at a time
On an HTTP/1.1 connection, a request must finish before the next starts. Browsers work around it by opening about six connections per host, each paying its own TCP and TLS handshakes (Day 11). Old optimizations like bundling all JavaScript into one file and spreading assets across several domains existed mainly to dodge this limit.
HTTP/2: multiplexing over one connection
HTTP/2 splits requests and responses into small binary frames and interleaves them on one connection, so dozens of requests are in flight at once. That's multiplexing. It also compresses headers, which matters when every request repeats the same cookies and auth headers. It grew out of Google's earlier SPDY protocol.
The remaining weakness is underneath. All those streams share one TCP connection, and TCP delivers bytes strictly in order. When one packet is lost, TCP holds back everything after it, for every stream, until the packet is resent. That's head-of-line blocking at the transport layer, and lossy mobile networks trigger it constantly.
HTTP/3 and QUIC: no transport head-of-line blocking
HTTP/3 replaces TCP with QUIC, a transport built on UDP. QUIC tracks delivery per stream, so a lost packet only delays the stream it belongs to. It also combines the transport and TLS 1.3 handshakes into one round trip, can resume earlier connections with zero round trips, and survives a phone switching from Wi-Fi to cellular without reconnecting.
That zero round trip mode, 0-RTT, has a catch: data in the first flight can be captured and replayed by an attacker. That's harmless for GET /products/42 but dangerous for POST /payments. Servers and CDNs typically accept 0-RTT only for idempotent requests (Day 14).
| HTTP/1.1 | HTTP/2 | HTTP/3 | |
|---|---|---|---|
| Transport | TCP | TCP | QUIC over UDP |
| Requests per connection | One at a time | Many, multiplexed | Many, independent streams |
| One lost packet blocks | That connection | All streams on the connection | Only its own stream |
| Handshake before data (new connection) | TCP + TLS | TCP + TLS | One combined round trip |
How to enable HTTP/2 and HTTP/3
Browsers and servers negotiate the version automatically. HTTP/2 is agreed during the TLS handshake. HTTP/3 is advertised by the server in a response header, and the browser switches on later requests:
curl -sI https://www.cloudflare.com/ | grep -i alt-svc
# alt-svc: h3=":443"; ma=86400 <- "HTTP/3 is available on port 443 for a day"In most architectures the version that matters is spoken between the user and your edge: the CDN or load balancer. Turning on HTTP/3 there gives users the benefit even if the edge talks HTTP/1.1 or HTTP/2 to your app servers inside the data center, where networks are fast and rarely lose packets. Remember to allow UDP port 443 through firewalls, or clients quietly fall back.
Two exceptions. gRPC (Day 16) needs HTTP/2 all the way to the service, so an edge that downgrades to HTTP/1.1 breaks it. And old HTTP/1.1 workarounds hurt on HTTP/2: spreading assets across several domains forces extra connections and handshakes, undoing multiplexing. Remove them when you upgrade.
HTTPS, HTTP over TLS, is a given for any public API: it encrypts traffic and proves the server's identity with a certificate. HTTP/2 in browsers, and HTTP/3 always, require it.
Check yourself
HTTP/2 multiplexes every stream over one TCP connection, and TCP delivers bytes strictly in order. When one packet is lost, every stream waits until it's retransmitted, which is transport-level head-of-line blocking. On lossy mobile links that can make HTTP/2 slower than several HTTP/1.1 connections. HTTP/3 over QUIC avoids it.
Their firewalls block UDP port 443, so browsers try QUIC, fail, and fall back to HTTP/2 over TCP. Nothing is broken; only open networks benefit.
Yes. Enable HTTP/3 at the CDN or load balancer; it terminates the user's connection and can talk HTTP/1.1 to the app servers internally.
HTTP/1.1 handles one request at a time per connection, so browsers opened several connections and still waited behind slow responses. HTTP/2 multiplexes many requests and responses over one connection, compresses headers, and removes the need for tricks like domain sharding.
It uses QUIC, which implements reliable, encrypted streams on top of UDP. Each stream is delivered independently, so a lost packet only delays its own stream. QUIC also combines the transport and TLS handshakes and can keep a connection alive when the client's network address changes.