CDN Connection Coalescing: Reducing Overhead

· Priya Sharma · 4 min read

What Is Connection Coalescing

Connection coalescing is an HTTP/2 feature that allows a browser to reuse an existing connection for a different hostname, if the connection's TLS certificate covers both hostnames and the DNS resolves to the same IP address. For foundational context, read DNS Resolution in CDN: How Users Reach the Nearest Edge — FlyFish NWA.

# Browser has a connection to cdn.example.com (IP: 104.16.1.1)
# Certificate covers: *.example.com
# www.example.com also resolves to 104.16.1.1

# Instead of opening a new connection for www.example.com:
# → Reuse the existing cdn.example.com connection

Why It Matters for CDNs

CDN customers often serve content from multiple hostnames: www.example.com for HTML, cdn.example.com for static assets, api.example.com for API calls. Without coalescing, the browser opens separate TCP+TLS connections for each — 3 hostnames = 3 handshakes = 120-300ms of connection overhead.

Performance Comparison: Edge vs Origin Processing
Metric Edge Processing Origin Processing Improvement
Latency (p50)8–15 ms120–300 ms15–20x faster
Cache Hit Ratio85–95%N/AReduces origin load
TLS Handshake1–5 ms (nearby PoP)50–150 ms10–30x faster
Bandwidth Cost$0.01–0.04/GB$0.05–0.12/GB3–5x cheaper
Availability99.99% (multi-PoP)99.9% (single DC)10x fewer outages
CDN Protocol Stack — Layered network architectureCDN Protocol Stack — Layered network architecture CDN Protocol Stack Application Layer HTTP/2, HTTP/3, WebSocket Layer 5 Security Layer TLS 1.3 / Certificate Pinning Layer 4 Transport Layer TCP (HTTP/2) or QUIC (HTTP/3) Layer 3 Network Layer IP / Anycast Routing Layer 2 Physical Layer Fiber / Peering / IXP Layer 1 Higher ← Abstraction → Lower
Figure 1: CDN Protocol Stack — Layered network architecture

With coalescing, one connection serves all three: saving 2 complete TCP+TLS handshakes (80-200ms).

Requirements for Coalescing

All three conditions must be met:

  1. Same IP address — Both hostnames resolve to the same IP (common with CDN Anycast)
  2. Valid certificate — The TLS certificate covers both hostnames (wildcard *.example.com or SAN list)
  3. HTTP/2 or HTTP/3 — Coalescing only works with multiplexed protocols

CDN Coalescing in Practice

CDNs like Cloudflare serve all customer domains from the same Anycast IP ranges. If multiple domains are on the same CDN and share a certificate, the browser can coalesce connections across them.

Protocol Handshake Flow — Connection establishment sequenceProtocol Handshake Flow — Connection establishment sequence CDN Request Flow — From Browser to Edge CDN Request Lifecycle Step 1 DNS Lookup Step 2 TCP Connect Step 3 TLS Handshake Step 4 Edge Server Step 5 Cache Check Step 6 Response Cache HIT → 5ms response Cache MISS → Fetch origin 0ms ~50ms (cache hit) ~200ms (cache miss)
Figure 2: Protocol Handshake Flow — Connection establishment sequence

Benefits are especially significant for:

Configuring for Coalescing

Connection Coalescing vs Domain Sharding

Domain sharding (splitting assets across multiple hostnames to increase parallel connections) was an HTTP/1.1 optimization. With HTTP/2, it's counterproductive:

ApproachHTTP/1.1HTTP/2
Domain shardingBeneficial (more parallel downloads)Harmful (prevents coalescing, wastes connections)
Single domainBottleneck (6-connection limit)Optimal (one multiplexed connection)

If you're still using domain sharding from the HTTP/1.1 era, consolidating to fewer hostnames will improve HTTP/2 performance.

Monitoring Connection Efficiency

Chrome DevTools → Network tab shows connection IDs. Check if requests to different hostnames share the same connection ID (indicating successful coalescing). Multiple connection IDs for same-CDN hostnames indicate coalescing isn't working — check certificate coverage and DNS resolution.

External References

References & Standards: OWASP CDN Security · RFC 7234