Welcome to the WP Mayor Guide to WordPress Content Delivery Networks. I’ve written this guide keeping the absolute beginner in mind. I shall discuss the basic working principle of a Content Delivery Network and talk about its many advantages. At the end of the guide I’ve shed some light on how a managed WordPress hosting is beneficial to your website. Here’s a quick index to help you navigate:
- What’s a CDN?
- How does it work?
- The advantages of using a CDN
- The very best CDN services for WordPress
- Free CDNs that work like a charm
- Integrating CDN in Managed WordPress hosting
Let’s get started!
What is a CDN?
A Content Delivery Network (CDN) is distributed network of servers strategically located across the globe, housed in various data centres. The goal of a CDN is to serve or transfer data requested by another server (which is usually an end-user like you and me) – with high availability and performance. When an end-user requests data, the job of the CDN is to serve it from a server which is geographically closet to the requestor’s location. There are a handful of free CDN that work flawlessly – I’ve discussed them later on in this guide. Most commercial CDN services employ two pricing models:
- Fixed amount of bandwidth per month – the higher the amount, lower the price per GB.
- ‘Pay as you go’ model which is intended for lower traffic web sites.
- It’s worthwhile to note that the price of a CDN also depends on the requestor’s location. Data transferred to the Asia-Pacific region is usually more expensive compared to data transfer to European and North American countries.
Type of Data Transferred:
I’ve mentioned that a CDN serves static data. What exactly is static data? Glad you asked! Static data includes downloadable content like images, videos, audio clips, archives, etc. Apart from that, the CDN can also host a multitude of other data content such as:
- Live Streaming Media: These include video on demand (VOD) services of different forms.
How does a CDN work?
We now understand that a CDN has multiple servers located across the globe. To understand how a CDN works, let us consider a website – your blog for example. The first thing you do in order to integrate a CDN, is upload all the static files of your website – downloadable stuff, CSS & JS files, images, etc. – to the CDN using their control panel. In WordPress, you don’t have deal with which files to upload – WordPress (with the help of a plugin) does it for you. You can also add a CNAME records to your domain from your domain’s control panel or cPanel for a more professional look – but that’s optional.
Once you’ve uploaded the files, the CDN makes copies of them in all its servers (which can range from less than a hundred to over a thousand). When an end-user visits your site, the CDN network quickly determines which server in its network is closest to the end user and serves the static data from that server. Thus, the data is served at a very high speed (performance) resulting in lower response time.
Perks of using a Content Delivery Network:
Now that you know the underlying principle, let’s take a quick look at some the enormous advantages of using a CDN:
- Higher PageRank: Your site’s speed increases and Google loves speedy sites. Remember those 200+ factors Google uses to rate your site? Neither do I, but speed is one of them – and an important one too.
- Improved UX: A faster site equals lower load time, which paves way to a better user experience (UX). Nobody likes a slow site when the average Internet speed in the technologically sound regions is well over 1 Mbps!
Better Security:As mentioned earlier, the CDN makes copies of your website’s static data in all its servers. Any malicious attempts (except MySQL database injections) would be fruitless!As Tim Nash points out, this is completely wrong. There are 100s of other ways in which your site is vulnerable. So at best, a CDN improves security by redundancy. Please read Tim’s comment for a better explanation.
- Cost Saving: When you use a CDN, the majority of the bandwidth of your hosting server is saved, since the static files are served from the CDN network. I’m not talking about the shared hosts that provide unlimited bandwidth, but the ones with serious firepower like Virtual Private Servers (VPS) or dedicated servers. Bandwidth is expensive when it comes to private servers and that’s where the CDN comes in handy. You end up saving money and a blazing fast website!
WordPress CDN Benchmarks – Before & After using MaxCDN
Seeing is believing. And that is why we’ve complied a list of benchmarks to give you first hand experience of the “before and after effect” of a CDN. We used three tools to benchmark a demo/experimental site – GTmetrix, Pingdom and WebPageTest.
Details about the test site:
- WordPress Version: 3.8.1
- Theme: Echolake by Elegant Themes
- CDN provider: MaxCDN
- Plugin: W3 Total Cache
- Host: Shared host
- Web Server: LiteSpeed
- Caching Enabled: True for results in the second set, i.e. with CDN enabled
NOTE: We’ve conducted the first test without using any form of caching enabled. In the second set, we’ve used W3 Total Cache to implement caching and the CDN. If you want a clearer, unbiased picture, please use the Mark Jaquith’s WP-Stack CDN plugin to conduct the tests. You’ll have to manually install the plugin, since it’s not available in the WordPress plugin repository. Again, thanks to Tim for pointing this out.
GTmetrix provides an excellent tool for comparison and has shown the highest difference with MaxCDN enabled. Following are snapshots of the scores, please click on each image to visit the site for detailed information.
WebPageTest is a renowned webpage benchmark tool. We haven’t quite compressed the experimental site’s images, so you’ll find that the scores are affected by it. Regardless, the benefits of using a CDN are clearly visible. I suggest that you follow each link for detailed results.
Last but certainly not the least, Pingdom is the most popular tool when it comes to web page tests. We’ve selected New York as the test location for both cases to bring you the most accurate results:
We also ran another set of benchmarks with the test server located in Amsterdam, Netherlands. This is what we found:
This gives us a difference of 1.90 seconds – the site when powered by MaxCDN loads 1.09 seconds faster than the site without MaxCDN, as compared to the minor 0.8 seconds difference recorded when the test server was in New York.
The reason – physical distance. New York and Quebec are 844 miles apart whereas Amsterdam and Quebec are 3,115 miles apart. A difference of 2271 miles between the two test locations, accounts for the benchmark differences. If this be the case, imagine what kind of a difference it would make for visitors from Asia?
You might think there isn’t quite a difference in the site’s performance in the Pingdom trials. This is where the problem of a shared host lies. The server load is extremely variable which is why, testing at different times would yield different results – even with the benchmark parameters (i.e. the state of the site) remaining constant. Had we tested this on a VPS or a dedicated server, the results would have been much more distinctive.
The Best CDN Services for WordPress
Now that you know the details of a CDN, let’s take a look at some of the best CDN providers for WordPress.
Stating with the industry leader – MaxCDN is usually the first name that comes to mind when talking about WordPress CDN. In December 2013, they merged with their parent company NetDNA and now provide two CDN solutions – standard and enterprise. MaxCDN’s enterprise solution is used by giants like GitHub, BuySellAds and other high traffic websites.
CloudFront is one of the oldest CDN providers – with and gigantic network. Insanely high traffic websites like Amazon.com, IMDb and 9GAG – all use Amazon CloudFront. Their pricing strategy is based on the requestor’s location and traffic demand. Bandwidth is usually cheaper when the data transfer is within the North America and Europe. They have a Monthly Bandwidth Calculator which helps you estimate a bandwidth amount for their ‘pay as you go’ pricing model. Did you know that you can try out the full CDN experience for free, thanks to Amazon Cloudfront’s free usage quota? All you need is a credit card to get started. Your card won’t be charged if you remain within the free limit.
Other notable CDN services include Fastly, CloudFlare, RackSpace Cloud Files, CacheFly, CDN77 and CDN.net.
Free CDNs for WordPress
If you’re looking for a free CDN service that really does have an effect on speeding up your site, you could try the following:
Photon by Jetpack
Jetpack is one of the most popular and super-useful WordPress plugins offers a plethora of useful modules one of which is called Photon – a free integrated CDN service for any self-hosted WordPress site. All your site’s images are uploaded and served from Automattic’s own network which is powered by EdgeCast.
Best known for its free CDN service, CloudFlare also offers inbound traffic filtering and malware protection to enhance your website’s security. The paid version of CloudFlare has a lot more to offer including premium CDN, DDoS protection and enhanced malware protection and custom analytics.
Holding it Together
Some of us who aren’t quite experienced or rather familiar with integrating CDNs – manipulating CNAME records, creating new pull zones and a whole lot of other technical issues – can get a bit stressful, even intimidating a times. If you’re one of those folks who want their site to be managed by professionals, then we would highly suggest an alternative – managed WordPress hosting.
The beauty lies in the fact that everything – from changing domain name records, integrating CDN, hourly backups, WordPress core and plugin updates, disaster recovery and malware/DDoS protection – is managed by the hosting company. What’s the catch? Well, you’re going to have to spend top dollar every month depending on the workload you want off your shoulders. It guarantees you peace of mind and some companies like WP Engine even answer support tickets within 30 minutes, on Christmas morning!
The price is determined by the number pageviews your site generates each month. You can upgrade, downgrade and buy additional pageviews anytime. However, the term ‘pageviews’ can be a bit misleading, so we recommend reading up a bit on the provider you’re planning to host your site in, and then opt for a plan.
In an event when an article goes viral and you experience a massive traffic surge (kudos, btw!) – you won’t have to worry about downtime. All you need to do is upgrade to the next higher package or buy additional pageviews. It’s like buying bandwidth, really.
This concludes our CDN article. I hope you’ve learnt some new stuff today. In any case, I’d love to hear your thoughts. If you have any questions, the comment form is all yours.
If you enjoyed this post, make sure to subscribe to WP Mayor’s RSS feed.