What IS A Content Delivery Network, Exactly?

What Is A CDN?

I’m sure you’ve heard on at least one occasion that content delivery networks are awesome. They significantly improve the speed at which your website can deliver content. Not only does that make for a better user experience, there’s also mounting evidence that faster-loading pages tend to rank higher than those that load slowly (though not, perhaps, for the reasons that you might think).

Sounds like a pretty good deal across the board, no?

It certainly does. There’s just one problem, though. While the above explanation certainly does make a compelling case as to why you should use a content delivery network, it doesn’t really offer much in terms of explaining how a CDN actually works.

That’s what we’re here to talk about today. How does a content delivery network function? More importantly, how can you tell when you should use one for your own site?

Let’s say you’re running a website from a server in New York City. The browser of every single person who connects to your website first needs to make a DNS request to discover the website’s IP address. Once it has that it can initiate a connection to your site. Then the data needs to be sent and received.

That last part is where lag generally tends to occur. In order to load each ‘piece’ of data on your site, the host and the client need to communicate. Even a slight delay in the communication could significantly increase load times.

For anyone in the tri-state area, this is pretty much a non-issue. They should be able to request, receive, and load data from the website with relative speed. But what about visitors based out of other locations?

What about people from Austin? Or Los Angeles? Or Canada?

That’s where content delivery networks come in – they essentially function as digital middlemen for your website, delivering content to visitors geographically removed from your location. They do this through the use of edge servers – proxy caches that contain a copy of your website. When an edge server receives a request from a browser, it goes through the following process:

  • First, it checks its cache to see if it contains the required content. If it has the content, then it sends it directly to the requesting browser without having to ask the origin server on which your site lives.
  • If the cache doesn’t – or it has expired – then the CDN sends a request to the origin server to retrieve the necessary information.
  • The information is transmitted from the edge server to the browser, and the process repeats as many times as necessary.

For websites with a geographically-diverse clientele, content delivery networks are all but necessary in order to ensure that everyone receives the best experience possible. By positioning edge servers in geographically-strategic locations, website owners can ensure that their visitors load their website just about as fast as they would if they were connecting from next door. That’s the value of a CDN – and why you should use one.

Now, with that said, they aren’t necessarily the right choice for everyone. If your website is generally only frequented by visitors within a limited geographic range – for example, if you’re a local restaurant – then you can probably get away without using one. For everyone else, though?

The world’s getting more global with each passing day – and CDNs are among the best ways to deal with that.

Image: Flickr/Marco Belucci