How to set up a WordPress CDN

by on 9th April 2012

One of the key issues we face today as technical marketers is addressing cross device/channel compatibility, and page speed performance. That last one’s a major issue. Specifically, the cost of ignoring site speed as a performance and revenue indicator.

Why bother with site speed?

Because it costs an awful lot of money not to. This post explores implementing MAXCDN’s CDN service in WordPress.

Tom recently gave a top presentation on the topic of site speed for content marketers at BrightonSEO in May 2016.

Organisations like Walmart and Mozilla have seen exponential improvements in revenue and conversion from controlled tests on site speed, yet many marketers still don't embrace the need for performance optimisation.

Organisations like Walmart and Mozilla have seen exponential improvements in revenue and conversion from controlled tests on site speed, yet many marketers still don’t embrace the need for performance optimisation.

While there’s an awful lot more to page speed optimisation, some of the most notable improvements in page load can be achieved through serving your content via CDN. Obviously further enhancements are avialable which is why Tom’s work on the topic is so powerful; achieving a 240% page load time improvement by implementing changes in the following categories:


Read Tom’s full presentation here.

So, we already know there’s a strong business benefit to improving site speed. It’s possible to see figures as high as 1% conversion rate loss for every second in site speed squandered.

Assuming a directly proportional relationship between page load and conversion rate, the potential gain for this site is obvious.

I’ve Optimised Everything on My Site, So How does a CDN work?

Put simply, a CDN caches all of the objects on your site (for instance; images, JS files and CSS files) and serves them from a location that is usually closer to the request location. This should mean that visitors see a faster page load. By hosting all of your static files on a CDN, it’s fair to assume there’ll be a perceived increase in page load, especially in locations far from your own hosting (assuming the CDN has good coverage there).


I wanted to learn about CDN implementation, so I opened an account with MaxCDN.

The end to end set-up process should have taken around 10 minutes. There was a little complication owing to our site being an SSL site, but I’m pleased to note that MAXcdn will work with your own SSL certificate, provided that you have a wildcard certification that will certify any subdomain.

How to configure WordPress with a CDN

Firstly, open an account with your CDN provider of choice. In MAXcdn, create a new “pull zone”:

create new pull zone

You can name the zone anything you like, in our case, “SEOg”. Set the “origin server URL” name to match your domain name and enter your intended custom CDN domain (the location from which your static files will be. Don’t worry, you don’t have to do anything with DNS just yet:

new pull zone at MAXcdn

After you’ve created your new pull zone, you’ll see this message:

our new pull zone is live

Take a note of the two domains, your custom domain ( and the pull zone location generated by MAXcdn – Now head to your DNS control panel:

(This assumes you’re using CPanel to manage your domain a, cname and MX records via your web host. If you’re not using CPanel, you’ll have to follow slightly different steps to get to the DNS zone editor at your registrar – it’s very easy though, so don’t be put off if this is new):

Select “Advanced DNS Zone Editor” and the domain you’d like to edit, here:

finalising DNS

Protip: Use more than one CDN address serving JS and CSS separately. This provides the benefit of asynchronous downloading of those files.

Configure MAXcdn with W3 Total Cache

W3 Total Cache is our caching plugin of choice. It’s easy to use, fast and reliable. What’s most powerful about the plugin is compatibility with several well known CDN service providers. Here’s how to set it up with MAXcdn very quickly:

W3 Total Cache general settings CDN

Firstly, select “NETDNA / MaxCDN”. Don’t enable just yet, just click “Save all settings”. Next, head to the CDN configuration from the options along the top of the settings page.

CDN config in W3 total cache 2

You’ll see a space for your CNAME, so complete that and fetch the API key from MaxCDN here:

api config in maxcdn

As soon as you’re done, click “Save all settings” and select “Test NetDNA” to make sure all is well. The outcome should look like this:

This makes a great weekend project – give it a go!

I quite enjoyed getting our site set up with a proper CDN. The process is not without its pitfalls – especially if you happen to use SSL to serve your content. Still, with a little perseverance and background reading, it becomes relatively simple (and extremely interesting). The main limitation I faced were problems related to multiple subdomain names (cdn.*, cdn2.*, etc) because of the SSL certificate. We have a wildcard certificate that wasn’t validating easily in the MaxCDN interface. To save time and hassle I elected to creating a separate certificate which was fine for one subdomain but not for multiple addresses.

The performance panel provided is initially very interesting. We’re now serving the US far more locally, (so I might expect our latency to be vastly improved in the US) but, we’re serving the UK and all of Europe from Amsterdam. I suspect that overall performance won’t be improved much in the UK. My initial tests certainly make me feel the improvement locally is marginal, but still improved.

CDN performance

I used Pingdom tools to evaluate overall object loads and got some initially interesting results from New York, with one exception to the observation that we appear quite a lot quicker:


Initial data is almost irrelevant though, so I’ll be watching Google Analytics (site speed report, segmented by country) for a reduction in page loads from our main traffic generating sources over the next few weeks. I’m hoping for an improvement across the board, and certainly no increases in the UK:

analytics page load

A few useful resources

I’d like to recommend you take a look at these (extremely useful) blog posts:



  1. Nice detailed post, i did always mean to get around to doing a detailed post on my progress. I’ve had a fair bit of success with Amazon Cloudfront lowering load times from 10-15 seconds down to 4-6 seconds and a further improvement with a drop to 2-3 seconds by moving to

    I did use the multiple subdomains to get a nice boost in load times, but also if there is a blip sometimes CSS or Images don’t load correctly first time. I’m sure that Amazon may not be the fastest on the market but it’s surely cost effective.

    The next step I’m looking at is moving to a true CDN provider to get than extra improvement in page load time. Some of the other improvements would be to remove “Facebook” and “Google AdSense” for that instant boost…

    • Thanks for dropping by David! Yes, I have to admit it takes time to unpick who provides what in the CDN industry. My biggest “gap” I suppose is linking performance by geo-location to a service provider than has strong coverage in those areas, so I’m really trying to find a service that is cost effective, but can reduce load times in my key traffic markets.

      It’s really interesting work! This will without a doubt improve our process for making CDN recommendations during SEO projects, too.

    • Nice. Site speed is important.

  2. Ah yes Amazon would be great if they offered an easier way to use their edge locations depending on users location, i think there is something kinda in the works but certainly that will be the big move in 2012.

    I know seems to be the most aggressive in the international expansions but I had options of London,Amsterdam or USA as the asia-pacific locations aren’t ready for all VPS services just yet. Certainly want to look at integrating CDN into more projects but will think that’s something more for side projects at this stage.

  3. Another great post Richard!

    Greatly appreciate the fact that you published it on a bank holiday :)

  4. Very nice post/summary. I’ve been meaning to setup a CDN for one of my main sites but keep putting it off, I’m still curious to know how much of an impact it would actually have, my site loads fairly fast currently (very well optimized for loading + W3 Total Cache also.)

    I’ve got CDN on my list of things to setup for the Summer, here’s hoping that I actually get it done

    • Hi Dan – I’ve put a follow up in the calendar around 2 weeks from now. That should give us a solid feel for the pros / cons.

      I can tell you now though – in the UK a 90k image loads .5seconds faster via a direct URL rather than via the CDN in the UK. It sort of bothers me that I’m trading one very fast web connection in the UK for one that’s probably less exciting in the UK but consistently OK everywhere.


  5. Hmm, how comes, your Google Page Speed is still only 88?

  6. Good tutorial.

    I recently setup a CDN (jumped on Yoasts MaxCDN offer post) on my tennis blog. Also hosted at Tsohost courtesy of your recommendation in a blog post a long time ago!

    Turned out to be a lot simpler than I imagined and support was top class.

    MaxCDN + Cloudflare + W3 Total Cache has so far worked seamlessly.

    Although I will add it’s not clear cut on the benefits, and even though I haven’t had chance to run any specific tests, based on visiting my own blog via several PC’s it doesn’t appear to be stupidly quick in the UK. Looking forward to reading your Pro’s & Con’s post because of that.

  7. I was trying to explain to a client the other day the importance of having a site load quickly, I must click off a few sites every time I’m shopping online because they take forever loading, and if I’m doing this I’m sure Google will be too?

  8. Any update on this one Richard? Did you see any changes in page load speed metrics?

  9. On the slide comparing loading times from Google, Amazon and your client’s site, all 3 tests were ran from different locations (Amsterdam, Dallas, New York). Wouldn’t that lead to wrong conclusions or is there some other reason for that choice?

    • As with all posts; I advise my readers to go and do the tests themselves. For Amazon and Google the location really doesn’t make enough of a difference to care. MaxCDN happens to have nodes in those cities and I think the switching between locations was merely a product of testing the CDN nodes on SEOgadget properly. Obviously there’s a bit more to my work on this than just this post. I’m planning to do an update, so thanks for the reminder.

  10. Hi Richard,

    Did Google Analytics show up a gain in speed from moving to CDN?

  11. Hi Richard,

    I have a SEO related question. If I implement a CDN for a WordPress site, will the site suffer in terms of losing image traffic because the images are being served from a sub domain on the CDN network rather than being served from my site. Is there a way where I could count the traffic that has been generated from the related CDN network?

  12. Woah! I’m really digging the template/theme of this blog. It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between usability and appearance. I must say that you’ve done a amazing job with this. Also, the blog loads super fast for me on Internet explorer. Excellent Blog!

Comments are closed.

We're hiring – check out our careers page Careers

Get insights straight to your inbox

Stay one step ahead of the competition with our monthly Inner Circle email full of resources, industry developments and opinions from around the web.