FE Lead · Lesson 16 reference card
"HTTP/1 had head-of-line blocking at the HTTP layer, HTTP/2 fixed that but not TCP's, HTTP/3 fixed TCP's by replacing it with QUIC. The architectural fix for waterfalls is SSR data colocation — not protocol choice."
| Version | Fix | Remaining problem |
|---|---|---|
| HTTP/1.1 | Persistent connections | 1 req/connection → 6 TCP workaround |
| HTTP/2 | Multiplexed binary streams | TCP HoL: 1 dropped packet = all streams blocked |
| HTTP/3 | QUIC/UDP, per-stream reliability | UDP firewalls; QUIC CPU cost; observability |
Many streams on one TCP connection, interleaved as frames. Eliminates HTTP-layer HoL. Domain sharding → active regression.
Static table (61 common headers) + per-connection dynamic table. Repeated headers (Cookie, UA) → 1–4 bytes.
Browsers couldn't check cache before accepting push → waste. Replaced by 103 Early Hints (browser uses own cache logic).
| Use case | Algorithm | Level |
|---|---|---|
| Static JS/CSS/HTML (CDN) | Brotli (pre-compressed) | 11 (offline only) |
| Dynamic SSR responses | gzip | 6 (fast default) |
| Dynamic (if CPU budget) | Brotli | 4–5 |
| JPEG/WebP/AVIF/woff2/zip | None — already compressed | — |
Brotli = ~20–26% smaller than gzip for text. Level 11 = ~100× slower to compress → pre-compute only. Requires HTTPS.
<link rel=preconnect href="https://api.example.com"> in <head>fetchpriority="high" + rel=preloadPromise.all() / RSC parallel routes, not sequential awaitsAccept-Encoding.| Header | Purpose |
|---|---|
Alt-Svc: h3=":443" | Server advertises HTTP/3 support; browser upgrades next request |
Accept-Encoding: br, gzip | Client declares compression support (Brotli first = preferred) |
Content-Encoding: br | Server declares applied compression |
Link: </s.css>; rel=preload | In 103 Early Hints — browser fetches before 200 arrives |
Domain sharding under HTTP/2 — it was a H1.1 workaround. Under H2, sharding creates many TCP connections instead of sharing one → defeats multiplexing, adds DNS+TLS cost. Remove it.
"H2 eliminates head-of-line blocking" — only at the HTTP layer. TCP HoL blocking remains: 1 dropped packet holds ALL streams. H3/QUIC fixes TCP HoL. Two distinct problems.
0-RTT on POST/mutations — 0-RTT early data is replayable. Safe for idempotent GETs only. Never use for booking POSTs, form submissions, payments.
Brotli level 11 for dynamic responses — 100× slower than gzip. Pre-compute for static assets; use gzip 6 for SSR/API. Claiming Brotli is always better ignores the CPU cost.
"Switch to H3 to fix LCP waterfalls" — waterfalls are sequential dependencies, not protocol overhead. H3 speeds each hop; it can't collapse a chain of useEffect→fetch→render→image. Fix: SSR data colocation.