What is a CDN?
Content Delivery Network, told as a story about copy depots in every town.
Everyone travels to the castle for its picture books.Far towns wait a long time, and the castle gate is jammed.
Everyone wants the same books.The castle fetches the same thing over and over. What a waste.
A CDN puts a copy depot in every town.You get it from the nearest depot. If it's missing, one trip to the castle — then it's in the depot for good.
When the castle changes a picture, the depots swap their copies.When a copy expires, or the castle says toss it, a fresh one comes down.
Your own letters never go in the depot.Only things everyone reads get copied; your own letters mean a trip to the castle. And until a copy is swapped, you may see the old one.
A CDN = copies of the castle's picture books in a depot in every town, so everyone gets them from nearby.
Content Delivery Network. Photos, videos and picture books — things everyone reads — come from the depot; your own letters come from the castle. Cloudflare, Akamai, AWS CloudFront. Same idea as the hubs all over town (SASE), but for picture books instead of security.
When grown-ups say it
- Cache
- The copy. The book left in the depot. → the same as the runner's basket
- Edge · PoP
- The town depot. A depot placed near people. → the same spot as the hubs all over town
- Origin
- The castle. Where the original lives. Visited only when the depot lacks something.
- TTL (time to live)
- The expiry date. How long a copy stays. Past it, a fresh one is fetched.
- Cache hit · miss
- In the depot · not in the depot. There? Right away. Not there? One trip to the castle.
- Purge
- Toss the old edition. The castle clearing depot copies before they expire.
- Static · dynamic
- Picture books · my letters. Shared things get copied; things meant just for you don't.
- Origin shielding
- On busy days the depots take the crowd. The castle gate stays quiet. Even a mob of thieves (DDoS) hits the depots first.