DEV Community

Sreekar Reddy
Sreekar Reddy

Posted on • Originally published at sreekarreddy.com

๐ŸŒ CDN Explained Like You're 5

Local libraries instead of one central

Day 29 of 149

๐Ÿ‘‰ Full deep-dive with code examples


The Library Story

Imagine there's basically one big library for your whole country.

People from Sydney, Melbourne, Perth... all end up going to that one place to borrow books.

Traffic jams everywhere! ๐Ÿš—๐Ÿš—๐Ÿš—

Better idea: Put small libraries in every city!


CDN = Content Delivery Network

Your website is hosted in Sydney.

Someone from Tokyo visits โ†’ data travels allllll the way from Sydney. Slow!

With CDN:
CDN copies your files to servers worldwide:

  • Tokyo โ†’ Tokyo server โœ…
  • London โ†’ London server โœ…
  • New York โ†’ New York server โœ…

Most people get files from a nearby location.


What Gets CDN'd

  • Images
  • CSS and JavaScript files
  • Videos
  • Static pages

Anything that doesn't change often.


Famous CDNs

  • Cloudflare
  • AWS CloudFront
  • Akamai
  • Fastly

In One Sentence

CDN copies your files to servers around the world so users download from a server near them, making your site faster.


๐Ÿ”— Enjoying these? Follow for daily ELI5 explanations!

Making complex tech concepts simple, one day at a time.

Top comments (0)