Content Delivery Networks (CDN)
CDN is an umbrella term spanning different types of content delivery services: video streaming, software downloads, web and mobile content acceleration, licensed/managed CDN, transparent caching, and services to measure CDN performance, load balancing, multi-CDN switching and analytics and cloud intelligence.
Question 1: What is a CDN?
CDN’s (Content Delivery Networks) are the hidden backbone infrastructure behind millions of websites that you never see and rarely hear about. They are, for the most part, the lifeline of many websites, and give users uninterrupted access to content throughout the internet. Whether you know it or not, the chances of you coming into contact with a CDN on a daily basis are almost 100%. Before you start understanding what a CDN is, you need to recognize the issue they were designed to solve. Otherwise known as “latency”, this is the very frustrating occurrence content taking a long time to load once a request for the information has begun. If you’ve ever visited a website and had to wait for ages for images to load, or other content, then you’ve successfully experienced latency. No one likes a slow website, and having slow loading web pages, can cause you to lose valuable traffic. As a website owner, your Number 1 priority is to make sure your website loads quickly and users don’t need to wait for content to load, which is where CDN’s come in.
A CDN also acts as load balancer; most CDN providers have networks of server clusters per location, which mean they can easily handle a large number of requests than if you hosted the files on your own server.
Question 2: How does a CDN work?
Content Delivery Networks serve as intermediary servers between your website and your visitors’ computer. Let’s use the following example to illustrate how a CDN comes into play, and how it works to benefit you:
Let’s say you owned a website that’s hosted in Australia, yet your target market is global and not specific to only Australians. The time a website in Australia would take to load for someone in the UK would be roughly 5-15 seconds (depending on their internet speed.) In terms of website loading, that time is appalling and, a user will probably cancel the page load and go look somewhere else for the same product you are trying to sell from a competitor website. With a CDN, you’re taking a copy of your web pages or resources and storing them as a pre-cached copy on another server. So back to our example, if a user from the UK is trying to access your website in Australia, the CDN would serve your website content within the UK, rather than the user requests having to travel across the Indian Ocean and back just get access to your website content in Australia.
- Most CDN’s have multiple servers around the world, and there are two different types of CDN’s. There’s CDN’s that take copies of your resources, like images, stylesheet files and videos etc, then serve those resources to a visitor from a server that’s closest to the visitor. This reduces the number of requests needed between the users’ browser and your website, basically the fewer calls a browser needs to make to a website server, the better; and a CDN does just that, it reduces the number of requests needed to load a specific website page.
- The other type of CDN takes entire copies of your website and does the exact same thing, by serving your entire website from a location that’s closest to the website visitor. This type of CDN is usually more expensive and reserved for larger corporations.
Question 3: Why use a CDN?
If for example, you run a news website that has multiple images on certain articles, with some videos here and there then you’re most definitely going to want to use a CDN. All your images can be loaded from the CDN, rather than needing to be requested by individual calls from the users’ browser to your server, allowing your server to free up request paths to load other content, like text etc. The purpose of a CDN is to minimise the distance between your visitor and your content while reducing the number of requests a server needs to handle for resources.
Using a CDN not only improves your load times but also allows your website to handle more visitors to your site at the same time. If you’ve ever had your website go down due to a large traffic spike because your website was featured in some news article etc, then you could have prevented that downtime by using a CDN.
Question 4: How to choose a CDN service provider?
Choosing the right CDN provider varies on your budget. The Following Article gives a superb breakdown of the different types of CDN providers and their pro’s and cons. Alternatively, you can use the WPMU dev premium plugin which gives you access to all their plugins as well as their own CDN which does an absolutely brilliant job of speeding up your website. For a mere $49.95 a month, you honestly cannot get a better package in terms of premium plugins for just about any project, full backups, CDN network and website security; all built into one package.
Our top 5 independent CDN providers are:
Question 5: How to set-up a CDN within WordPress?
For the purpose of preventing this part of the lesson getting too boring and long for you, we’ll focus on our two main methods of connecting a WordPress site to a Content Delivery Network. Whichever way you choose, both will require the use of a plugin:
- Cloudflare Plugin
- WPMUDEV Hub Built-in CDN, so no configuring needed
Cloudflare Plugin Setup
- Before you do anything, make sure you backup your website and database before making any significant changes to your website
- Download the Cloudflare Plugin
- Install the plugin as you would any other plugin for WordPress
- Once installed and activated, hover over “General Settings” in your WordPress Admin area and scroll down to the Cloudflare menu option
- Enter your Cloudflare details in the Cloudflare Login screen (click here to signup if you haven’t done so already – It’s free don’t worry.)
- Enter your API Key within the Cloudflare Settings of your WordPress site
- Save API Credentials
- Load Optimized Defaults.
- Make sure “Automatic Cache Purge” is on as this will flush your cache every time you make a change on your site, and update the Cloudflare network with your new content to be delivered to your clients.
That’s it, that’s all you need to do to have Cloudflare delivery of your website assets like images, stylesheets etc.
There are many advantages of using a CDN as mentioned above, but using a service like Cloudflare offers some incredible stats for websites too:
- Websites load twice as fast on average
- Use up to 30% less bandwidth
- Website load experiences up to 65% fewer requests for resources, which in turn free up more resources for your website to handle more users
- Almost 90 Cloudflare servers around the world to cater to just about every user’s needs
Using a CDN makes sense, it’s just one of those things that helps improve website speed, user experience overall, and makes for a pleasant experience for anyone visiting a website. The advantages significantly outweigh the drawbacks, be it for a paid or free CDN. There’s no doubt that a paid for CDN will offer more benefits, but the free alternatives do a brilliant job for smaller websites.