What You Should Know About Using a CDN With WordPress

Let me start this post from a slightly different angle – the issue of site speed and availability. It’s no mystery that fast websites experience more success than their slower brothers and sisters. And the reasons are twofold.

First of all, users don’t like to wait for a website to load. That’s why most of the time after 4 seconds (more or less) they are gone for good.

Secondly, Google is not enjoying slow sites either. These days, site speed is a valid SEO ranking factor. No one knows the actual significance of this, but we can simplify the whole thing a bit and say that fast sites rank better!

So where does a CDN come into play here?

Quite simply, a CDN or a Content Delivery Network can help your site to load faster, and make it more available to everyone. The main strength of a CDN is that it improves the performance of a given site worldwide, not just in one location.

Here’s how it’s done (and how to take advantage of this potential in WordPress).

What is a CDN?

If you take a look at Wikipedia, you’ll see that CDN is defined as a distributed system of servers deployed in multiple data centers.

What this means in plain English is that many copies of your content get distributed across different servers, and then the server closest to the visitor’s location delivers it on demand. This makes the whole process a lot quicker, and also a lot less prone to attacks and malfunctions.

In other words, when you’re using a CDN, your site/blog is stored on multiple servers worldwide, instead of just one main server (the one you’re paying for).

This whole concept sounds really interesting, and I remember I was quite excited when I first heard about it. So how to get a piece of this CDN-pie for yourself…

Where to sign up for a CDN

Doing a simple Google search is a solution, but I don’t want to sound like Captain Obvious here, so I’m going to point you towards two specific companies.

One is WPWebHost. It’s a hosting company, but they do let you in on a bonus CDN offer (hosted by myinstantCDN) when you sign up for one of their hosting plans.

The other is MaxCDN – a company specializing in providing CDN services exclusively.

None of the above are free solutions, but this isn’t a surprise since we already know what a CDN can do for our sites and their performance.

Once you choose the CDN provider that seems the most suitable for your site, you will get all the access details and specific instructions on how to configure and launch your new CDN. However, some general tasks always remain the same.

How to connect a CDN account to WordPress

Not surprisingly, CDN is not a native functionality in WordPress. Therefore, in order to make it available, you need to install a third party plugin.

The best plugin for this is W3 Total Cache, which you may be familiar with already … but probably not for its CDN capabilities.

In essence, W3 Total Cache is much more than just a simple caching plugin like some people think. It’s actually a complex performance improving platform, where caching and CDN support are just two of many things it has to offer.

Once you have the plugin installed and activated, go back to your CDN admin panel or contact the support team, and get your individual CDN domain and CNAME RECORD.

(In some cases, you’ll have to create the CDN domain and the CNAME RECORD yourself by adding a resource in your CDN admin panel. This depends on the provider you sign up to, but there are always some tutorials available on how to get this done quickly, so I won’t get into detail here.)

Now go to the General Settings page of your W3 Total Cache and scroll down to the section marked as CDN.

Here, enable the CDN, and choose the CDN Type you’re going to be working with. As you can see (image below), there’s a number of different types available, but your provider will most likely instruct you to go with “Generic Mirror.”

cdn-screen-1

Once you save the changes, you can go to the CDN settings page of your W3 Total Cache (left menu).

Here, you get to set all the parameters of your CDN, things like: what type of files to host, whether or not to replace URLs for logged in administrators, and more.

But what we’re really after here is the main Configuration tab. This is where you get to add your custom CDN domain and the CNAME RECORD. Place it in the field next to the “Replace site’s hostname with” label.

After clicking the “Save all settings” button, your blog is fully integrated with CDN.

cdn-screen-2

To test if everything went well you can simply view the HTML source code of your site and notice if the image links are replaced with CDN URLs.

Keep in mind that if at any point in time you deactivate or delete the W3 Total Cache plugin, you will also disconnect the CDN from your blog.

In essence, the concept of CDN is a really brilliant one. You get improved protection against server crashes (your content is distributed across the internet), your site works faster in every location around the world, and it all happens in the background without you having to send the content to different locations by hand.

In the end, I guess you have to decide on your own if the investment is worth the money. I can only say that from my perspective, there are no apparent downsides to this, especially if you’re writing any sort of paid articles (or take part in any other method of monetization), and you want people to be able to access your content from any location in the world.

However, feel free to speak up if you beg to differ. Can you see any disadvantages of using a CDN?

there are 6 comments added

  1. nutsandbolts 20th November 2012

    I just recently started using MaxCDN and I have been absolutely thrilled with the results. Between the CDN, moving my hosting away from shared to my own small hosting business, and using a ThemeFuse theme (which eliminated the need for many of the plugins I used before), my site is screaming fast. It has made a huge difference in my bounce rate and traffic. I'm a convert!

    • Karol K 22nd November 2012

      That's the whole value of using a CDN. Thanks for commenting. :)

  2. dan 22nd November 2012

    This is one opinion but more than that can you make the font size smaller? Why not take a look at the LFC? http://largefontcoalition.org/..You know a font size this small was out of style oh say in 2002.. Thanks

  3. WPfix 23rd November 2012

    We use amazon cloudfront servers as a CDN on all our network websites.

  4. Serge 11th December 2013

    I will have to try MaxCDN. So far I have only used Cloudflare, the free plan, and it has definitely helped. Although I have also used WPengine with a couple clients and I think that has had the best performance as of yet. I'm still experimenting so I can make the best decision.

  5. James 15th January 2014

    Hi Karol, I like your post! My favorite CDN is keycdn.com. It is a cheap cdn but they got still good support and great performance. It is easy to integrate it with w3 total cache. They provided me with a tutorial how to do it. Keep up the good work! :)

(optional field)

HTML tags are not allowed.

Reset fields

back to top