NETLEARN
Lesson 01Distribution

CDN: Bringing Content Close to You

If everyone in the world had to fetch data from a single server in America, the internet would be slow. A CDN places copies of that content at hundreds of points near users, and you are almost always served by the closest one.

Layer
Layer 7 · Application + DNS
Reference
Architecture · Anycast, caching
Steps
6
Browserin Jakarta
Edge CDNnearest point
Origin serverorigin
legendrequestcautionresponsecontrolmessage in flight

Common misunderstandings

  • A CDN does not speed up personal data. Caching a page that contains user data can even make one user see another user's page.

Key notes

Anycast
A single IP address is announced from many locations; BGP sends you to the nearest.
Cache invalidation
The hardest CDN problem: making sure an old copy is replaced quickly when the origin changes.
Not everything qualifies
Personal content (login pages) is not cached; what usually is: static files like images, CSS, JS, video.
Errors that make sense
HIT/MISS status in headers helps diagnose: is this content really served from the edge?