HTTP/2

Protocol

Major revision of HTTP that adds multiplexing (multiple requests over one connection), header compression (HPACK), and server push. Eliminates head-of-line blocking at the HTTP layer.

Updated Mar 9, 2026

Full Explanation

HTTP/2 was a big deal when it landed. The killer feature: multiplexing. With HTTP/1.1, browsers open 6-8 connections per domain and each connection handles one request at a time. With HTTP/2, everything goes over a single connection with multiple concurrent streams. No more connection overhead, no more domain sharding hacks.

Header compression (HPACK) is the other big win. HTTP headers are repetitive—same cookies, same user-agent, same host on every request. HPACK compresses headers using a shared table, saving significant bandwidth especially on mobile.

For CDNs, HTTP/2 matters on both sides: between browser and edge (almost universal now) and between edge and origin (often still HTTP/1.1, but improving). Most CDNs support HTTP/2 to clients by default. The one catch: HTTP/2 still uses TCP, so TCP-level head-of-line blocking remains. That's what HTTP/3 fixes.

See the interactive Request Flow animation in the course to compare how requests flow in HTTP/1.1 vs HTTP/2.

Examples

# Check HTTP/2 support
$ curl -sI --http2 https://example.com/ | head -1
HTTP/2 200

# Nginx: enable HTTP/2
server {
    listen 443 ssl;
    http2 on;  # Nginx 1.25+
    # Or: listen 443 ssl http2;  # Older Nginx
}

# Verify with openssl
$ openssl s_client -alpn h2 -connect example.com:443 2>&1 | grep ALPN
ALPN protocol: h2

# Chrome DevTools: Protocol column shows h2 for HTTP/2 requests

Video Explanation

Frequently Asked Questions

Major revision of HTTP that adds multiplexing (multiple requests over one connection), header compression (HPACK), and server push. Eliminates head-of-line blocking at the HTTP layer.

# Check HTTP/2 support
$ curl -sI --http2 https://example.com/ | head -1
HTTP/2 200

# Nginx: enable HTTP/2
server {
    listen 443 ssl;
    http2 on;  # Nginx 1.25+
    # Or: listen 443 ssl http2;  # Older Nginx
}

# Verify with openssl
$ openssl s_client -alpn h2 -connect example.com:443 2>&1 | grep ALPN
ALPN protocol: h2

# Chrome DevTools: Protocol column shows h2 for HTTP/2 requests

Related CDN concepts include: