DEV Community

Discussion on: Explain to me Like I'm 5: Content Delivery Network (CDN)

Collapse
 
jesusgollonet profile image
jesús gollonet • Edited

The key premise is:

They allow your users to get your content faster by hosting it in servers that are spread around many physical locations and delivering from the one that is closest to them.

The way they work from a high level is by storing (caching) copies of your data in those servers. When a user wants to see your cat picture, the DNS layer (the part of the internet that matches domain names with IPs) will find the closest CDN server to you. If that server has the picture that the user is requesting it will just deliver it to them. If it doesn't, the CDN server will request it from the origin server, then deliver it to the user and store a copy for all future users. Those additional users will not have to wait for the roundtrip between the CDN server and the origin server, so they'll get your cat picture faster.

There's way more to it of course, not sure if that's the right abstraction level you were asking for, but that's my rough understanding of CDNs