DEV Community


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

scottishross profile image Ross Henderson ・1 min read

Hey guys,

I have used CDN's in the past, and to be honest they've just been a "thing" that I know people use and it made things easier for me.

But how do they work and are they secure?

Discussion (4)

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

tbutterwith profile image
Tom Butterwith

Hi! Cloudflare (one of the biggest CDNs) have some great resources on their website. You should check these out.

scottishross profile image
Ross Henderson Author

Thanks, I'll read through them. Though I was hoping for a short TL;DR aha!

tbutterwith profile image
Tom Butterwith

😂 Apologies.
TL;DR: They work by caching your content across lots of servers globally, with the intention of having your content as close to the person requesting it as possible. Most of them are secured by requiring HTTPS connections, and are read only for everyone except the owner.

Forem Open with the Forem app