8 min
  • CDN
  • Caching
  • DNS
  • HTTP

CDNs and the edge

A CDN is not exotic. An edge server is an ordinary shared HTTP cache obeying exactly the RFC 9111 rules from track 4 — max-age, s-maxage, ETags, 304s, all of it. The only thing that makes it a CDN is where it sits.

Loading the Internet Simulator simulation…

The saving is distance, not work

The origin never heard about that request. Nothing was computed, nothing was queried, and the entire cost of the page was a handful of milliseconds to a machine in the same city.

The Age field is the giveaway: it says how long the edge has been holding this response, which is information no origin would ever send about itself. A miss shows you what was avoided:

Loading the Internet Simulator simulation…

The client sees one request and one response either way. Behind it, the miss paid for a whole round trip to the origin plus the origin's own work — and the next visitor gets the fast version because this one paid for it.

Check yourself
A response arrives with Age: 240 and Cache-Control: max-age=600. What do you know?

Getting you to the nearest edge

Two mechanisms do the steering, and they work at different layers.

The first is DNS. A CNAME points your name into the CDN's zone, which hands the CDN the right to decide the answer — the delegation from track 3, put to work. Short TTLs let it change its mind quickly.

The second is anycast: one address advertised from many places at once, so routing itself delivers each packet to the nearest announcement. There is nothing to look up and no decision to make at the client.

DNS steeringAnycast
DecidesPer lookup, by the CDNPer packet, by routing
SeesThe resolver’s locationThe client’s actual path
ChangesOn a TTLOn a routing update
Predict what happens next
You use a public resolver on another continent. What does the CDN's DNS steering see?

Key takeaways

  • An edge is an ordinary shared HTTP cache. What makes it a CDN is where it sits, not what it does.
  • The saving is distance rather than work: on a hit, the origin never learns the request happened.
  • The Age field is a cache reporting how long it has held a response, and is the clearest sign one is involved.
  • DNS steering works by delegating the answer through a CNAME, and sees the resolver’s location rather than the client’s.
  • Anycast steers at the routing layer instead, so there is no lookup, no decision, and no client-location problem.

Take it further