Advanced Topic 37 of 50 Computer Networks
CDN
Geographically distributed caches speeding content delivery.
How it works
A content delivery network is a geographically distributed set of edge servers that cache copies of content near users. Requests are routed, using DNS or anycast, to a nearby edge, which serves cached objects or fetches them from the origin on a miss. This reduces latency, offloads the origin and absorbs traffic spikes and attacks. Cache behavior is controlled with headers such as Cache-Control and by purge or invalidation APIs.
Step-by-step walkthrough
- A user requests an image.
- The nearest edge server checks its cache.
- On a miss it fetches from the origin once.
- The edge stores a copy.
- Later users nearby get it quickly, reducing latency and origin load.
Where it is used
Delivering images, scripts, video streams, downloads and entire websites, and providing TLS termination and DDoS protection, use CDNs from providers like Cloudflare, Akamai and Fastly.
Common pitfall
Stale content is served if cache lifetimes are too long or purges are missed. Caching personalized or private responses by mistake leaks data. Poor cache keys lead to low hit rates, and origin failures still matter on misses. Version asset filenames, set sensible TTLs and monitor hit ratio.
Where it fits in the course
CDN is topic 37 of 50 in Computer Networks, rated Advanced. It follows FTP and SSH. The next topic is Load Balancers.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Computer Networks quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Computer Networks quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is CDN?
Where do people use CDN?
What is the most common mistake with CDN?
What should I learn before this topic?
How can I practice it?
Is CDN hard to learn?
How long does it take to learn CDN?
Which topics are related to CDN?
What should I study after CDN?
Related topics
- FTP and SSH (Computer Networks)
- Load Balancers (Computer Networks)
- Email Protocols (Computer Networks)
- Proxies (Computer Networks)