Use HTTP/2: Faster, Multiplexed Connections
HTTP/1.1 limits browsers to 6 parallel connections per domain. HTTP/2 multiplexes unlimited requests over a single connection. Learn how to upgrade.
HTTP/2 is one of the biggest performance upgrades that requires zero code changes. If your server still speaks HTTP/1.1, you're leaving massive speed gains on the table.
HTTP/1.1 vs HTTP/2
| Feature | HTTP/1.1 | HTTP/2 |
|---|---|---|
| Connections per domain | 6 max | 1 (multiplexed) |
| Header compression | None | HPACK compression |
| Request prioritization | None | Stream priorities |
| Server push | None | Supported |
| Binary protocol | No (text) | Yes (faster parsing) |
The Waterfall Problem
With HTTP/1.1, the browser can only make 6 requests at a time to one domain:
HTTP/1.1 (6 connections):
[js-1] [css-1] [img-1] [img-2] [img-3] [img-4]
[img-5] [img-6] [font-1] [img-7]
HTTP/2 (1 multiplexed connection):
[js-1] [css-1] [img-1] [img-2] [img-3] [img-4] [img-5] [img-6] [font-1] [img-7]
(all download simultaneously)
How to Enable HTTP/2
Check Current Protocol
# Check from command line
curl --http2 -I https://yoursite.com 2>&1 | head -5
# If you see "HTTP/2 200", you're good
# If you see "HTTP/1.1 200", you need to upgrade
Nginx
# Enable HTTP/2 — just add 'http2' to the listen directive
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/ssl/certs/yoursite.crt;
ssl_certificate_key /etc/ssl/private/yoursite.key;
# Enable HTTP/2 push for critical resources (optional)
http2_push /styles/critical.css;
http2_push /fonts/brand.woff2;
}
Apache
# Requires mod_http2
# In httpd.conf or virtual host config
Protocols h2 h2c http/1.1
<VirtualHost *:443>
Protocols h2 http/1.1
SSLEngine on
SSLCertificateFile /etc/ssl/certs/yoursite.crt
SSLCertificateKeyFile /etc/ssl/private/yoursite.key
</VirtualHost>
CDN Providers (Automatic)
Most CDN providers support HTTP/2 out of the box:
| Provider | HTTP/2 | HTTP/3 | Notes |
|---|---|---|---|
| Cloudflare | ✅ Auto | ✅ Auto | Free tier included |
| Vercel | ✅ Auto | ✅ Auto | No config needed |
| Netlify | ✅ Auto | ❌ | Automatic |
| AWS CloudFront | ✅ Auto | ✅ Optional | Enable in distribution settings |
| Fastly | ✅ Auto | ✅ Auto | Automatic |
If you're using a CDN, HTTP/2 is likely already enabled.
Node.js (Express)
import { createSecureServer } from "http2";
import { readFileSync } from "fs";
import express from "express";
const app = express();
const server = createSecureServer({
key: readFileSync("./key.pem"),
cert: readFileSync("./cert.pem"),
allowHTTP1: true, // Fallback for old clients
}, app);
server.listen(443);
HTTP/1.1 Hacks You Can Remove
Some old optimization techniques are counterproductive with HTTP/2:
Domain Sharding — Remove It
<!-- ❌ HTTP/1.1 trick — splits requests across domains -->
<img src="https://img1.example.com/photo-1.jpg">
<img src="https://img2.example.com/photo-2.jpg">
<img src="https://img3.example.com/photo-3.jpg">
<!-- ✅ HTTP/2 — use one domain, multiplex everything -->
<img src="https://cdn.example.com/photo-1.jpg">
<img src="https://cdn.example.com/photo-2.jpg">
<img src="https://cdn.example.com/photo-3.jpg">
Sprite Sheets — Split Them
/* ❌ HTTP/1.1 trick — combined all icons into one image */
.icon-home { background: url(sprites.png) -10px -20px; }
.icon-user { background: url(sprites.png) -40px -20px; }
/* ✅ HTTP/2 — individual files load in parallel */
.icon-home { background: url(icons/home.svg); }
.icon-user { background: url(icons/user.svg); }
File Concatenation — Let the Bundler Decide
With HTTP/1.1, combining files reduced requests. With HTTP/2, smaller files enable better caching (change one module, only that file is re-downloaded).
HTTP/3 (QUIC)
HTTP/3 uses QUIC (UDP-based) instead of TCP:
- Faster connection setup — 0-RTT resumption
- No head-of-line blocking — packet loss on one stream doesn't block others
- Better on mobile — handles network switching (Wi-Fi ↔ cellular) gracefully
Most CDN providers now support HTTP/3 automatically.
Verifying HTTP/2
Browser DevTools
- Open Network tab
- Right-click column headers → enable Protocol
- Look for
h2(HTTP/2) orh3(HTTP/3)
Online Tools
- HTTP/2 Test
- SSL Labs — shows protocol support
Quick Wins Checklist
- Check current protocol:
curl --http2 -I https://yoursite.com - Enable HTTP/2 on your server (Nginx:
listen 443 ssl http2) - Or use a CDN that supports HTTP/2 automatically
- Remove domain sharding if you were using it
- Ensure HTTPS is enabled (required for HTTP/2 in browsers)
- Consider HTTP/3 via CDN providers that support it
- Remove unnecessary file concatenation / sprite sheets
Ready to stop wasting ad spend?
Track your landing page performance, monitor Core Web Vitals, and calculate exactly how much slow pages cost you.
Start Free — No Credit Card