Speed of Light & Why 1 RTT Turns Into 5
System design benchmarks often report origin server latency in isolation: “our API responds in 40 ms.” Yet a user in Mumbai or Sydney opening that same page hosted in us-east-1 (Virginia) stares at a blank screen for over two seconds. The culprit is physics multiplied by protocol waterfalls.
Light travels through glass fiber at roughly 200 km/ms (about 1.5× slower than in vacuum), and real internet cables do not follow straight great-circle paths (add ~1.25×–1.35× routing stretch plus router switching). A 12,800 km fiber path from Mumbai to Virginia therefore has a physical round-trip time (RTT) of roughly 170–220 ms. Before a browser paints a single pixel over HTTP/2, it pays that RTT sequentially:
- TCP Handshake (1 RTT): SYN → SYN-ACK → ACK across the ocean (~200 ms).
- TLS 1.3 Handshake (1 RTT): Cryptographic negotiation (~200 ms; HTTP/3 QUIC merges TCP+TLS into 1 RTT).
- HTML Request & TTFB (1 RTT + Origin SSR): Request travels to origin, origin queries DB and renders HTML (e.g., 140 ms), response returns (~340 ms). Total TTFB is already ~760 ms.
- Critical Subresources (1+ RTT): Only after parsing the HTML does the browser discover render-blocking CSS and the hero image, paying another full ocean RTT (~200 ms) plus transfer time before First Contentful Paint (FCP) and Largest Contentful Paint (LCP).
Edge PoP Architecture: HIT, MISS, Origin Shield & SWR
What Edge Caching Actually Moves Closer to the User
1. Local TCP & TLS Termination (Wins Even on a Cache MISS)
Anycast BGP routes the user to a Point of Presence (PoP) 10–20 ms away. Both TCP and TLS 1.3 complete locally in ~25 ms instead of ~400 ms. Even when the requested page is a cold MISS, the PoP forwards the HTTP request over a pre-warmed, persistent keep-alive connection pool to the origin, eliminating cross-ocean handshakes.
2. Static Assets vs. Full-Page HTML Caching
Putting only JS, CSS, and images on a CDN is the most common half-measure. While subresources load quickly, the HTML document still crosses the ocean and runs origin rendering. Because HTML is the root of the browser's critical rendering path, caching public HTML at the edge using s-maxage is what collapses TTFB from 800 ms to under 40 ms:
Cache-Control: public, max-age=0, s-maxage=60, stale-while-revalidate=300, stale-if-error=86400
max-age=0tells the user's browser to revalidate with the nearest PoP (so purges take effect immediately).s-maxage=60tells shared edge caches (CDNs) to serve the HTML fresh for 60 seconds.stale-while-revalidate=300lets the PoP serve a slightly expired response in ~18 ms while refreshing from the origin asynchronously in the background—hiding ocean latency from the user completely.stale-if-error=86400keeps serving the last good cached HTML if the origin suffers an outage.
3. Tiered Caching & Origin Shielding
A global CDN may run 300+ PoPs. If every PoP independently fetches from your origin on a cold start or after a cache purge, a single popular page triggers 300 origin renders. Tiered Caching (Origin Shield) places a small set of regional mid-tier caches in front of the origin. The first PoP miss populates the shield; the other 299 PoPs hit the shield instead of waking your origin database.
Worked Example: Mumbai User Loading a Virginia Origin
Consider a user in Mumbai on 100 Mbps fiber loading a product page hosted in us-east-1 (12,800 km away, ~205 ms WAN RTT, 140 ms origin SSR render, 240 KB hero image):
| Architecture | HTML TTFB | FCP | LCP (Hero Image) | What the User Feels |
|---|---|---|---|---|
| No CDN (Direct to Origin) | ~770 ms | ~1,030 ms | ~1,120–1,450 ms+ | Noticeable blank pause; degrades past 2.5s (“Poor” CWV) on 4G/3G |
| Static Assets Only at Edge | ~410 ms | ~460 ms | ~510 ms | Faster hero image, but initial blank wait still tied to Virginia |
Full Edge HTML (s-maxage + SWR) |
~55 ms | ~115 ms | ~165 ms | Instantaneous paint; feels like the server is in the next room |
Try the interactive Edge Caching & Page Load Time Sandbox above to race these exact paths side by side from Mumbai, Sydney, Tokyo, London, and São Paulo, and trigger cache purges or stale-while-revalidate refreshes in real time.
What You Can (and Cannot) Cache at the Edge
- Ideal for Edge HTML: Marketing pages, documentation, news articles, e-commerce product/catalog pages, public profiles, and read-heavy JSON APIs.
- Split Shell + Dynamic Islands: When a product page is 95% public but shows a personalized “Cart (2)” badge, cache the public HTML shell at the edge and hydrate the small user-specific fragment via an authenticated API call or Edge Worker (Edge Side Includes).
- Never Cache at Shared Edge: Account settings, checkout/payment state, private messages, or any response carrying user-specific PII—always emit
Cache-Control: private, no-store.
Production Failure Modes
- Cache Key Fragmentation: Emitting
Vary: User-Agentor including marketing query parameters (utm_source,fbclid) in the cache key creates thousands of near-identical variants, collapsing hit ratio from 95% to under 10%. - Cookie-Induced Cache Bypasses: Many CDNs automatically bypass the cache whenever a request carries a
Cookieheader. Strip analytics cookies at the edge before cache lookup for public routes. - Global Purge Storms: Issuing a wildcard purge (
/*) across 300 PoPs simultaneously creates a thundering herd against your origin. Use surrogate keys (cache tags), Origin Shielding, and request coalescing so only one fetch per key reaches the origin.