HTTP/2 and HTTP/3 are the modern protocols that power fast, secure web experiences. Both require TLS, both support multiplexing, and both eliminate many of the performance hacks (domain sharding, sprite sheets, concatenation) that HTTP/1.1 demanded. But they differ fundamentally in their transport layer: HTTP/2 runs on TCP, while HTTP/3 runs on QUIC, a UDP-based transport with TLS 1.3 built in.
This article compares the two protocols across performance, security, browser support, and server configuration. It is part of the SSL/TLS Configuration Guide. Verify your setup with the HTTP/2 Test and HTTP/3 Test tools on GF.dev.
HTTP/2 was standardized in 2015 (RFC 7540, updated by RFC 9113) and is now supported by every modern browser. It introduced three key improvements over HTTP/1.1:
103 Early Hints instead.HTTP/3 was standardized in 2022 (RFC 9114). Instead of TCP+TLS, it uses QUIC (RFC 9000), which runs on UDP and integrates TLS 1.3 directly into the transport handshake. This architecture change has several consequences:
| Metric | HTTP/2 | HTTP/3 |
|---|---|---|
| Connection Setup | TCP handshake + TLS handshake (2-3 RTT) | QUIC handshake (1 RTT, 0-RTT for resumption) |
| Head-of-Line Blocking | Solved at HTTP layer, not TCP layer | Solved at both layers |
| Packet Loss Impact | High (all streams stall) | Low (per-stream recovery) |
| Connection Migration | Not supported | Supported via Connection ID |
| CPU Usage | Lower (kernel TCP stack) | Higher (userspace QUIC stack) |
HTTP/3 shows the biggest gains on high-latency or lossy connections (mobile networks, intercontinental links). On low-latency, reliable networks (data center to nearby CDN), the difference is less noticeable.
Both protocols require TLS, but HTTP/3 mandates TLS 1.3 specifically, which means:
For more on TLS 1.3 cipher suites, see TLS Cipher Suites Ranked.
HTTP/2 is universally supported by all browsers and virtually all web servers. HTTP/3 support is now mainstream:
server {
listen 443 ssl;
http2 on;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
# ... rest of config
}Note: In Nginx 1.25+, the http2 directive replaces the old listen 443 ssl http2; syntax.
# Enable the module
sudo a2enmod http2
# In your VirtualHost
Protocols h2 http/1.1
sudo systemctl restart apache2server {
listen 443 quic reuseport;
listen 443 ssl;
http2 on;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
# Advertise HTTP/3 support
add_header Alt-Svc 'h3=":443"; ma=86400' always;
}The Alt-Svc header tells the browser that HTTP/3 is available. The browser will upgrade on the next connection.
Caddy supports HTTP/3 out of the box with zero configuration. Simply run:
caddy reverse-proxy --from example.com --to localhost:8080Caddy automatically provisions a TLS certificate, enables HTTP/2, and advertises HTTP/3.
After enabling HTTP/2 or HTTP/3, verify that clients are actually negotiating the new protocols:
h2 or h3 for each request.curl --http3 (requires curl 7.88+ built with HTTP/3 support) to test from the command line.Yes. HTTP/3 is not a replacement for HTTP/2 — it is a complement. Firewalls or networks that block UDP will prevent HTTP/3, and the client will fall back to HTTP/2 over TCP. Deploy both protocols so every client gets the best experience their network allows.
For the full TLS configuration that underpins both protocols, see the SSL/TLS Configuration Guide.