How HTTP/2 and HTTP/3 improve web performance over HTTP/1.1
HTTP/1.1 limitations, head-of-line blocking, HTTP/2 multiplexing, HTTP/2 header compression (HPACK), HTTP/3 QUIC, 0-RTT connection, connection migration, server push deprecation
HTTP/2 and HTTP/3
HTTP/1.1 opens up to 6 TCP connections per origin. If you have 30 assets to load, they queue. Each connection requires its own TLS handshake. Headers repeat uncompressed on every request.
HTTP/2 solves this with multiplexing: unlimited parallel streams over a single TCP connection. Headers are compressed with HPACK. This makes the HTTP/1.1 optimization of bundling files to reduce connections counterproductive โ HTTP/2 prefers many small files.
Check if your server supports HTTP/2:
curl -I --http2 https://example.com | grep HTTPHTTP/3 replaces TCP with QUIC (UDP-based), solving TCP head-of-line blocking โ a scenario where a single dropped packet stalls the entire connection. QUIC handles packet loss per-stream, so other streams continue unaffected.
HTTP/3 also provides 0-RTT connection resumption for repeat visitors โ the TLS handshake is skipped on reconnect, reducing TTFB significantly on lossy mobile networks.
# Nginx config to enable HTTP/2
server {
listen 443 ssl http2;
ssl_certificate /etc/ssl/cert.pem;
ssl_certificate_key /etc/ssl/key.pem;
}
# Enable HTTP/3 (QUIC) โ requires Nginx 1.25+
server {
listen 443 quic reuseport;
listen 443 ssl;
add_header Alt-Svc 'h3=":443"; ma=86400';
}