跪拜 Guibai
← All articles
CDN · Network Protocol · HTTP

CDN Architecture: How Edge Nodes and GSLB Fix the Latency That HTTP Can't

By 泯泷 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Latency from distance and network interconnect is a hard constraint that HTTP headers can't fix. Knowing how GSLB and cache hit rates work helps developers choose, tune, and measure CDN delivery, so a global audience gets consistent performance rather than multi-second waits.

Summary

HTTP and even HTTP/2 don't address the speed of light in fiber: at 200,000 km/s, a Beijing-Guangzhou round trip costs 20 ms before any processing. The internet is also a patchwork of carrier networks with few interconnection points; crossing networks means squeezing through a narrow bridge with thousands of other users. Router and gateway hops add per-node delays. For a user on one side of the globe hitting a site on the other, these factors multiply into multi-second waits.

CDN counters this with a dedicated private network that spans cities and carriers over high-bandwidth lines. It caches static resources on edge nodes near users, using push or pull methods. Dynamic resources can't be cached unless they carry a Cache-Control header with a short TTL, effectively treating them as static for that window.

To choose the right edge node, GSLB runs at the DNS level: the authoritative DNS returns a CNAME to the CDN's GSLB, which then evaluates user IP location, carrier, node load, health, and bandwidth to pick the best fit. The caching proxy then tracks hit and origin-fetch rates; commercial CDNs exceed 90% hit rates, multiplying origin capacity by 10x. Modern CDN services layer on SSL acceleration, content optimization, anti-leeching, and WAF.

Takeaways
— Light speed in fiber is ~200,000 km/s, so a 2,000-km round trip adds a hard 20 ms latency.
— Cross-carrier links are few and congested; each router/gateway hop adds parsing and forwarding delay.
— CDN builds a private cross-carrier network with high bandwidth dedicated lines, avoiding public congestion.
— Only static resources can be cached at edge nodes; dynamic resources require a Cache-Control header to be cached temporarily.
— GSLB uses DNS CNAME to redirect users to the CDN, then chooses an edge node based on IP location, carrier, node load, and health.
— Cache hit rate measures how often requests are served from cache; origin-fetch rate is the opposite. Commercial CDNs hit over 90% hit rate, giving a 10x capacity boost.
— Modern CDNs add SSL acceleration, content optimization, anti-leeching, and WAF.
Conclusions

HTTP/2's improvements focus on connection reuse and multiplexing, but they don't touch the physical propagation delay that dominates long-range traffic; CDN is a necessary layer.

The static/dynamic split means developers can't rely on CDN for personalized or computed content; they must design for cacheability to benefit.

The DNS CNAME approach makes CDN integration transparent to clients, but it adds an extra DNS lookup that can be optimized with DNS prefetching or TTL tuning.

A 90%+ hit rate indicates that most web traffic is static, but for content-heavy sites (video, images), the number is meaningful; for dynamic apps, it could be much lower, and CDN alone won't solve latency.

Concepts & terms
CDN (Content Delivery Network)
A network of proxy servers distributed across many locations, designed to serve content to users from a nearby node, reducing latency and load on the origin server.
Edge node
A CDN server located close to end users, caching content from the origin. It's the node the user actually connects to after GSLB routing.
GSLB (Global Server Load Balancing)
The CDN's brain that selects the optimal edge node for each user based on IP geolocation, carrier, load, and health, using DNS redirection.
CNAME
A DNS record that aliases one domain to another. In CDN, the authoritative DNS returns a CNAME pointing to the CDN's GSLB, triggering further DNS lookup for the best edge node's IP.
Cache hit / origin fetch
Cache hit: a request satisfied by cached content on an edge node. Origin fetch: a request that misses the cache and must be forwarded to the origin server. Hit rate vs origin-fetch rate are key CDN quality metrics.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗