Latency

Performance

The time delay between a request and the start of its response. For CDNs, it's mostly determined by physical distance, number of network hops, and TLS handshake time. Lower is better.

Updated Mar 9, 2026

Full Explanation

Latency is physics. Light in fiber travels at about 200,000 km/s. Amsterdam to Sydney is 16,000 km, so the absolute minimum round-trip time is 160ms. In practice, routing adds overhead—real-world RTT is closer to 250-300ms. That's why CDNs exist: put content closer to users and cut the distance.

Total page load latency isn't just one round trip. A typical page needs: DNS lookup (20-100ms) + TCP handshake (1 RTT) + TLS handshake (1-2 RTT) + HTTP request/response (1+ RTT). For a user 100ms away, that's 400-600ms before the first byte of content arrives. A CDN edge 10ms away cuts that to 40-60ms.

CDNs reduce latency in multiple ways: Anycast routing to the nearest PoP, persistent connections to origin (avoiding repeated handshakes), HTTP/2 multiplexing, TLS session resumption, and pre-fetching popular content into cache.

See the interactive Request Flow animation in the course to visualize how latency accumulates through each step of a CDN request.

Examples

# Measure latency to a CDN edge
$ ping cdn.example.com
round-trip min/avg/max = 4.2/5.1/6.8 ms

# Measure full HTTP latency breakdown
$ curl -w '\nDNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTLS: %{time_appconnect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n' -o /dev/null -s https://cdn.example.com/

DNS: 0.012s
Connect: 0.018s
TLS: 0.032s
TTFB: 0.038s
Total: 0.045s

Video Explanation

Frequently Asked Questions

The time delay between a request and the start of its response. For CDNs, it's mostly determined by physical distance, number of network hops, and TLS handshake time. Lower is better.

# Measure latency to a CDN edge
$ ping cdn.example.com
round-trip min/avg/max = 4.2/5.1/6.8 ms

# Measure full HTTP latency breakdown
$ curl -w '\nDNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTLS: %{time_appconnect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n' -o /dev/null -s https://cdn.example.com/

DNS: 0.012s
Connect: 0.018s
TLS: 0.032s
TTFB: 0.038s
Total: 0.045s

Related CDN concepts include: