Heard of a CDN, but not exactly sure what it really means? Read this article to get a quick and easy crash course on the benefits of content delivery networks.
Picture this: It's 400 B.C. in the height of the Roman Republic. You're walking along the aqueduct carrying a grocery list etched in your wife's neat chiselhand, determined not to forget the eggs this time. You enter the market and collect your things, but as you walk up to the checkout, you discover that you left all your cash in another robe. No problem, you can just walk over to a nearby ATM and extract some of that hard-earned denarii, right? Only, there’s no ATM. You fall to your knees, cursing Zeus and Poseidon that there isn't some system of distributing information like account balances, or better still, the very contents of those accounts! And that, class, is where the beauty of Content Delivery Networks comes in.
What are CDNs?You may have heard of Content Delivery Networks (CDNs) as a tool that webmasters use to speed up their sites. And while the digital workings of getting a CDN architected, developed and deployed is fairly technical, the principles are extremely simple. In fact, it’s the same principle behind why you go to a grocery store instead of a farm: the grocer is just plain closer. The food and produce isn’t made there, but if you had to drive 50 miles to get fresh milk, that favorite morning bowl of cereal would be a lot harder to come by.
When you type in a web address like www.google.com, your browser is actually asking Google’s servers to send back all of the resources needed to display that page. That includes things like the code to position search results, to manage what happens when you run a new query and whatever the latest flavor of their logo is. All of those things have to be downloaded over wires that can run for quite a long distance. A CDN is a transparent way to physically move many of the resources of a webpage closer to your computer.
For web developers (and Volusion merchants!) who choose to use a CDN, instead of just chucking every file in one central folder on the server, certain files (more on that in a minute) can instead be placed on their content delivery network. It may seem like you’re just putting those files in a different bin, but the CDN automatically distributes copies of those resources to specialized servers located in many geographically distinct regions. Later, when that page’s URL is typed into a browser, depending on where you are physically in the world, the closest server in the CDN is the one that actually feeds those resources to your browser. By shortening the distance the various components of the webpage have to travel, content delivery networks help to lower the time it takes to start seeing that page, while reducing the opportunity for transmission errors to be introduced. In the image below, the left half shows the simple configuration of serving all your web files from one place, while the right shows how CDNs can bring portions of those files closer to their ultimate recipients.
Image source: Wikipedia
Additionally, CDNs only solve part of the problem when it comes to actually “getting” to a webpage; they make the trip to the server shorter. But if you’re sitting pretty on an old dial-up modem, or in a place where the WIFI coverage is spotty, it’s still going to take a while to get those files from the server. Likewise, CDNs don’t magically compress the size of a file any more than a regular server would, so sticking a 5 megabyte video clip of your sister staring at her cat for three hours won’t make it magically download faster just because it’s on a CDN. This means that it’s still a good practice to keep files as small as possible, to optimize images for the web using a program like Photoshop and to be aware of what a CDN can and can’t do.
Extra perksThere are a number of secondary benefits to using a CDN that might not be obvious upon first glance. All modern browsers impose a limit on the number of resources (images, scripts) which can be downloaded concurrently from the same domain in order to prevent a bottleneck on slow connections. Nowadays, however, connection speeds are such that these artificial limits usually hinder performance by preventing resources from being downloaded more expediently. These limits can be circumvented by placing some of those resources on a different domain, such as a CDN. If your browser limits concurrent connections to only two, it would be possible to download two non-static files from your main server and two static images from your CDN at the same time—a 200% boost.
Another benefit to placing static content on your CDN is caching. Whenever you visit a webpage, the resources it downloads are stored locally on your machine for a time (unless you’ve disabled caching). This allows a browser to check to see if it already has a copy of some resource requested by a webpage, loading it from the local hard drive instead of wasting resources on downloading another copy. This is like getting ready to head to the grocery store, only to remember at the last minute that you have a spare bag of Cheetos stashed out-of-sight at the back of the pantry. CDNs are especially good at telling browsers whether their files have been changed since the last time your browser downloaded them, and if they haven’t, the download can be safely skipped and the resource loaded locally.