LearnViz CompSci
Home / Learn / Computer Networks / CDN

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

  1. A user requests an image.
  2. The nearest edge server checks its cache.
  3. On a miss it fetches from the origin once.
  4. The edge stores a copy.
  5. 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

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Computer Networks quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is CDN?
Geographically distributed caches speeding content delivery. It belongs to Computer Networks and is an advanced-level topic.
Where do people use CDN?
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.
What is the most common mistake with CDN?
Stale content is served if cache lifetimes are too long or purges are missed.
What should I learn before this topic?
Start with FTP and SSH, the topic just before it in Computer Networks.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Computer Networks quiz.
Is CDN hard to learn?
It is an Advanced topic. Expect to read the explanation more than once and to connect it with earlier topics. Working through a small example by hand helps most.
How long does it take to learn CDN?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to CDN?
FTP and SSH, Load Balancers, Email Protocols are closely connected. The full list is in the related topics section of this page.
What should I study after CDN?
Continue with Load Balancers, the next topic in Computer Networks.

Related topics