A CDN, or Content Delivery Network, keeps copies of website content on servers placed in different locations. When you visit the site, the CDN tries to send that content from a server that’s physically closer to you. Less distance. Less waiting.

What Happens When You Open a Website?

Say Raj is sitting in Mumbai and opens an online store hosted on a server in London. Without a CDN, his browser may need to request files directly from that London server every time he visits. The request travels there. The response travels back. Then the browser starts putting the page together.

With a CDN in front of the website, things change. The CDN has servers spread across different regions, often called edge servers or points of presence. If a useful copy of the requested file is already stored nearby, the CDN serves it from there instead of going all the way back to the original server.

So Raj might get an image from a nearby edge server while the main website server stays in London.

The First Request

The first visitor requesting a particular file may trigger the CDN to fetch it from the original server. The CDN then stores a temporary copy based on the site’s caching rules.

After that, another visitor requesting the same file can receive the cached version. Much less back-and-forth.

What Does a CDN Actually Store?

• Images are a common target because large image files can take longer to move across long distances.

• CSS and JavaScript files often sit in the cache too, which keeps page assets closer to the person loading them.

• Dynamic content is trickier because the information may need to come directly from the origin server, especially when it’s personalised.

Cache Rules Matter

The website owner decides how long certain content should stay cached. A logo might remain there for quite a while. A page showing live account information needs a different approach.

And if the original file changes, the CDN needs to know when its cached copy is no longer valid. That’s why cache-control settings matter more than they first appear.

Why Does This Make Websites Faster?

Distance is the simple answer, but there’s more happening underneath. A CDN can reduce the amount of work handled by the origin server because repeated requests for cached files are handled at the edge.

That matters when traffic suddenly jumps. Imagine Priya opening her laptop each morning and stopping to reopen the same five tabs before starting work. Now imagine someone else keeping those tabs ready nearby. Less repeated effort.

The website feels quicker because the browser gets important files without waiting for every request to travel back to the main server. You stop noticing the infrastructure. Honestly, that’s the whole point.

What Happens If the CDN Doesn’t Have the File?

Then the CDN goes back to the origin server and requests it. Once received, the CDN can store the response according to its caching rules and serve future requests from that edge location.

There can also be routing decisions behind the scenes. The CDN looks at factors such as where the visitor is located and which edge location is available, then directs the request accordingly.

And that’s why a CDN isn’t magic. It’s more like having copies of frequently requested website content placed closer to the people asking for it. When the setup is good, the technology disappears into the background.