CDN & edge cache
Studies in this cluster, in series order. Each one keeps its own URL.
Networking
TCP, TLS, load balancers, and why the p99 lives in the handshake.
CDN & edge cache
6 studies- 1.CDNs, Cache Hierarchy & Origin ShieldingEdge→mid-tier→shield→origin; s-maxage/SWR; cache keys; purge races; request collapsing.
- 2.Cache Keys & VaryThe cache key is the identity of a variant. Cookie in Vary or raw query strings explode cardinality; normalize host/path and put only true content axes in the key.
- 3.SWR & stale-if-errormax-age is hard freshness; stale-while-revalidate hides revalidation; stale-if-error keeps serving through origin 5xx. Together they are a latency and availability tool, not a correctness tool.
- 4.Purge & Generation TokensInstant purge races with shields; soft purge plus generation tokens / surrogate keys make invalidation deterministic. Double-purge or bump the token when the shield can refill stale.
- 5.TLS Termination & Anycast EdgeEdge TLS plus Anycast cuts handshake RTT and shares one VIP worldwide. Trade-off: anycast can flap, keys live at the edge, and origin still needs a private path (mTLS).
- 6.Request Collapsing / CoalescingWhen N waiters miss the same key, one fetch goes upstream. Collapsing is local; origin shield is topological. You still need single-flight at every tier or a popular expiry looks like a DDoS.