Are you looking to speed up your WordPress site? If you’ve already ran through our other WordPress performance tips, another way to speed up your site is to integrate a content delivery network (CDN).

In this post, I’ll show step by step how to set up your very own WordPress CDN using KeyCDN. While KeyCDN is a paid service, they offer a free 30-day trial with no credit card required. So following this tutorial won’t cost you a dime to get started.

How Does a CDN Make Your WordPress Site Better?

We’ve written a number of posts about why you should use a CDN, so I won’t go too in-depth here.

Normally, when a visitor heads to your site, they have to download all of your site’s static assets from your server, no matter where in the world they’re located. So, even in Vietnam, I might have to download assets from, say, your New York server.

CDNs change that by mirroring your data around the globe. So instead of having to download from New York, I could grab those same assets from a Singapore data center. That means faster page load times and happier users.

Why KeyCDN?

If you want more in-depth thoughts, you can check out Joe’s KeyCDN review. But I like KeyCDN for a few different reasons:

  1. They offer a 30-day free trial with no credit card required.
  2. They have their own plugins which make integration easy.
  3. Their fees are low – from $0.04 per GB down to $0.01 per GB

That means if your site uses 100 GB of bandwidth in a month, you’re only on the hook for $4. Not too bad, right?

Of course, if low fees aren’t enough, you might want to check out my list of free CDNs.

And if you’re willing to pay a bit more, MaxCDN is another good option. It’s what Daan uses for wplift.

How to Set Up KeyCDN for WordPress

The process for setting up KeyCDN for WordPress is fairly straightforward. There’s only one part where it might get a little tricky because I’ll split the directions into two parts:

  1. One set if you’re using W3 Total Cache
  2. One set if you’re not. If you’re not using W3 Total Cache, I’ll show you how to do it using KeyCDN’s CDN Enabler plugin.

So once you get to Step 3 in the instructions below, make sure you follow the guide that applies to your site.

Step 1: Sign up For KeyCDN

Let’s start off slow – to get started, you first need to head on over to KeyCDN and sign up for an account. As I mentioned, you’ll get 30-days free without even needing to enter a credit card.

They’ll send a verification link to your email address, so make sure you click that to activate your account before continuing.

Step 2: Create a New Pull Zone

Pull zone is a weird term if you’re a beginner. I know it confused me at first.

But all it really means is that KeyCDN will copy your images/scripts to their own server so that they can distribute them globally. I guess they will “pull” your content onto their server. Got it?

Ok, so to do that, click on Zones:

Then, you need to enter the details for your new zone:

  • Name – make sure you don’t make it something explicit :) It will be part of your public CDN URL. Also, make sure it’s all lowercase.
  • Zone Status make sure it’s active (that’s the default)
  • Zone Type – make sure it’s set to “Pull”. Again, that should be the default
  • Origin URL – just enter the base URL for your website

Once you’ve entered everything, click Save.

Then go grab a cup of coffee or scroll your Facebook feed while KeyCDN deploys your new zone:

Pay special attention to the “Zone URL” – you’ll need it for the next step. You should just go ahead and copy it to your clipboard.

Step 3.1: Connect KeyCDN to WordPress with W3 Total Cache

Once your zone is deployed, you’re ready to sync KeyCDN up with WordPress. This is the part where I’ll split the instructions in two.

First, I’ll show you how to do it with W3 Total Cache. Then, I’ll show you how to do it using KeyCDN’s CDN Enabler plugin. I’ll also show you two ways to use CDN Enabler because things can are a little different depending on whether you’re using HTTP or HTTPS.

If you’re using W3 Total Cache, go to Performance → General Settings and scroll down to the CDN section. Then, enable the CDN and choose the Generic Mirror option:

Make sure to save your settings. Then go to Performance → CDN. Scroll down to Configuration and enter your zone’s URL (remember – this is what I told you to copy to your clipboard in the previous step):

You can leave SSL Support as the default (Automatic). Then make sure to save your settings. And you’re all done! KeyCDN should start working right away. I’ll tell you how to verify that at the end of this post.

Step 3.2: Connect KeyCDN to WordPress with CDN Enabler

If you’re not using W3 Total Cache, you can use KeyCDN’s CDN Enabler plugin to set everything up.

It’s free, so you can install it directly from your WordPress dashboard:

Once it’s activated, head to Settings → CDN Enabler:

Assuming you’re using HTTP, then you just need to enter your Zone URL in the CDN URL box and make sure to save your settings. That’s all!

If you’re using HTTPS (if you’re not already, you can get a free SSL certificate), then you need to do things a little differently to ensure everything works:

First, you need to make sure you enable SSL for your pull zone in KeyCDN’s interface. To do that, go to Manage:

Then click Show Advanced Features, scroll down to the SSL area and choose Let’s Encrypt from the dropdown:

Then, when you configure Cache Enabler, make sure to enter your Zone URL as HTTPS and choose the Enable CDN for HTTPS connections option:

I know this is a bit complicated, but I’m trying to cover all potential scenarios here! If you haven’t installed an SSL certificate, literally all you need to do is enter your Zone URL in Cache Enabler and click save. Things only get a little more complicated if you’re using SSL.

Step 4: Verify That KeyCDN is Working Properly

If everything went according to plan, you should now see your images being loaded by KeyCDN, rather than your own server:

To verify that, you can just right-click on the image and inspect it with Developer Tools.

Final Thoughts

I know things got a bit hairy there with all of the different potential scenarios. But configuring KeyCDN for WordPress really is very simple. It should only take you about five minutes to get up and running.

If you have any questions regarding your specific situation, leave me a comment and I’ll try to help out!


Colin Newcomer is a freelance writer and long-time Internet marketer. He specializes in digital marketing, WordPress and B2B writing. He lives a life of danger, riding a scooter through the chaos of Hanoi. You can also follow his travel blog.

Siteground Hosting
Does WPLift load fast for you? That’s because we use Siteground for hosting, WPLift readers can click here to get up to 60% off hosting for your site.

Disclosure: This page may contain affiliate links for which we will receive compensation if a purchase is made.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Leave Yours +

6 Comments

  1. Followed the W3TC method and it doesn’t work. Items being pulled from KeyCDN are HTTPS (which they should be), but they only exist at HTTP.

    Any idea why that could be? I’ll get a mixed content warning if I leave it to HTTP.

    • Fixed it. Needed to enable ‘Shared SSL’ within KeyCDN’s settings. Might want to add this to the tutorial?

      • Hey Dan, sorry I did the W3 Total Cache with HTTP and the Cache Enabler with HTTPS. My test site doesn’t give me free SSL so I couldn’t enable it for the W3 Total Cache version unfortunately.

        For anyone else, if you read step 3.2, I show you how to set up HTTPS on KeyCDN. You can just follow that if you need to enable HTTPS.

  2. Hi Colin,

    If I follow your (nice and clear, thank you!) instructions for setting up keycdn through the fastest cache plugin, would my site suffer from Google not seeing my keyword-optimised urls, and therefore lose traffic as a result?

    I’m trying to set up KeyCDN as they seem the most cost effective, especially in the short term, but it’s absolutely essential that Google can still see the name/description of my graphic urls rather than just some random cdn-esque file name.

    I am probably worrying unduly, but it’s what I seem to do!

    Thanks for any help, in advance. It will be much appreciated!

    Tim

  3. Very Very nice post. its a very useful and outstanding article. Thanks for that.

  • Comments are Closed

Our Sponsors

SEND ME FREE WORDPRESS STUFF!

Join our Newsletter to Receive 6 Free WordPress Themes

We will also send you our weekly Newsletter packed with the Latest WordPress Content.

We will look after your email & Never Spam!

You have Successfully Subscribed!