Skip to main content
App basics: HTTP, auth, dataLesson 1 of 11

HTTP/1.1, HTTP/2 and HTTP/3

A page needs dozens of files. The meaning of each request (method, path, headers, status) is the same in every HTTP version. What changes is how the bytes travel: one request at a time, many streams on one TCP connection, or streams over QUIC on UDP. Status codes are covered in When You Type an Address.

Version—
Connections—
Round trips before 1st request—
Head-of-line blocking—
Server sideBrowserNeeds 40 filesTCP + TLSOrdered byte streamQUICUDP · TLS 1.3 insideLoad balancerPort 443Server 1Web · gRPCServer 2Web · gRPCGET /app.js
RequestResponse / reportAppears in a later step

What you will learn

  • A request is a method, a path, headers and an optional body
  • Keep-alive and why HTTP/1.1 opens several connections
  • ALPN picks the version inside the TLS handshake
  • HTTP/2 streams, and the TCP loss problem they still have
  • HTTP/3 over QUIC, Alt-Svc and the UDP fallback
  • Why gRPC over HTTP/2 needs per-request load balancing

The three versions compared​

HTTP/1.1HTTP/2HTTP/3
TransportTCP (+ TLS)TCP + TLS (h2), cleartext h2c between servicesQUIC over UDP, TLS 1.3 built in
Message formatText linesBinary frames on streamsBinary frames on QUIC streams
Requests per connection at onceOne response at a timeMany interleaved streamsMany independent streams
Header compressionNoneHPACKQPACK
Head-of-line blockingPer connection, at HTTP levelAt TCP level, when a packet is lostOnly the stream that lost data
Round trips before the first request (new connection, TLS 1.3)221 (0 with 0-RTT resumption)
How the version is chosenDefaultALPN h2Alt-Svc header or DNS HTTPS record, then ALPN h3
SpecRFC 9112RFC 9113RFC 9114

Try it yourself​

curl -sv --http1.1 -o /dev/null https://<domain>/ 2>&1 | grep -E 'ALPN|^> GET|^< HTTP' # Forces HTTP/1.1
curl -sv --http2 -o /dev/null https://<domain>/ 2>&1 | grep -E 'ALPN|^< HTTP' # Offers h2 via ALPN
curl -sI https://<domain>/ | grep -i alt-svc # Does the server advertise h3?
curl -s --http3 -o /dev/null -w '%{http_version}\n' https://<domain>/ # Needs a curl built with HTTP/3
openssl s_client -connect <domain>:443 -alpn h2 </dev/null 2>/dev/null | grep ALPN # "ALPN protocol: h2"

In browser DevTools, right-click the Network table header and turn on the Protocol column to see http/1.1, h2 or h3 per request.

Check yourself

  1. You scale a gRPC service from 1 to 4 Pods behind a plain ClusterIP Service, but one Pod still gets almost all calls. Why?
  2. On a corporate network, DevTools never shows h3 for a site that offers HTTP/3, yet the page loads fine. What is the most likely reason?
  3. On a lossy mobile network, HTTP/2 is no faster than HTTP/1.1. What explains this?

Further reading: RFC 9110 HTTP Semantics · RFC 9113 HTTP/2 · RFC 9114 HTTP/3 · RFC 9000 QUIC · Evolution of HTTP (MDN) · gRPC load balancing · When You Type an Address · HTTPS and Certificates