Get pro WordPress tips or your money back!

How to Choose a CDN for WordPress

Have you ever been pulled in so many directions with the busy demands of life that you wish you could just snap your fingers and create a clone of yourself to help keep up?

In technology, we call that clone a Content Delivery Network (CDN). In this article, I explain the “what” and “why” of CDNs, and offer guidance for choosing the best CDN for WordPress sites.

WordPress Support
Photo by NeONBRAND on Unsplash

How a Content Delivery Network Works

To start, let’s take that “busy demands of life” analogy one step further. Imagine you’re an important business executive at a global corporation, and you have offices all over the world. You’re occasionally called to perform in some of these more remote locations, but your home is in New York City.

Now if you were needed in your Shanghai office, it would probably be more efficient to send your Taiwan-based “clone” instead of traveling there yourself from New York. Well, that’s essentially how a CDN works, and even better, it does all the decision making for you too.

The place where you host your website is your “home” or origin server. A lot of people don’t realize this, but even though your website is accessible all over the world, your database and files are usually stored in one physical location. The video below does a great job of describing exactly how a CDN can improve your website performance:

If you’re using a quality web host (like our Managed Hosting solution), your website is stored in an Enterprise-level infrastructure, but it’s just as likely that your website files are stored on a server in your weird cousin’s basement from that time during the Thanksgiving holiday when he helped you set up your blog (I hope the latter isn’t true).

A Content Delivery Network makes copies of all of the static files on your cousin’s basement web server (images, pdfs, CSS, JavaScript, etc), and makes real-time copies to servers all over the world. CDNs use geolocation technology to detect the location (generally region, it doesn’t know their actual address) of your site visitors. With that information, it makes real-time decisions about whether they should send files from your origin server (your web host), or one of the dozens of other servers — these are called edge servers — from around the globe.

A CDN does all of this in the background without any special configuration or direction from you. After initial setup, CDNs are typically a “set and forget” technology.

Why Do We Need Content Delivery Networks?

CDNs make the web faster. In the same way that it takes you longer to travel to Shanghai than your clone in Taiwan, physical distance has an impact on the amount of time it takes a file to move too.

Let’s say I’m in Salt Lake City and the website I’m visiting has an origin server in New York City. That website will load more slowly than if it were using a CDN with an edge server in Denver, for example. Now in this Denver vs. New York City scenario, the performance gains may not be super obvious, but as the distance between visitors and origins increase, the performance gains become much more noticeable when using a CDN.

Bill Nye Science Meme Gif

I don’t want to get too Bill Nye here, but although information (ie. data from your website) can theoretically travel the speed of light, in practice that’s simply not the case. Network quality varies all over the globe, and even things like weather can have an impact on the speed at which data travels. Until we reach human enlightenment and perfect our ability to move data, CDNs will be a nice stopgap so we can still enjoy fast performing websites.

Which CDN is Right for Me?

Tunnel time-lapse photo
Photo courtesy of Matthew Schwartz on Unsplash

There are a number of different factors to consider when choosing a CDN for WordPress. Depending on the complexity of your website, you may want to consult with a professional, but here are the primary things you’ll want to consider:

  • Cost – CDNs typically have a ‘pay-per-use’ model which means the more files you serve and the more visitors you have, the more expensive your monthly fees become. Managing costs while still maintaining a high-performance website can be a fine line to walk.
  • Overall performance – How much does using a CDN improve your site performance?
  • Ease of Use – The fastest CDN in the world isn’t helpful if you need an engineering degree from M.I.T. to use it.

Here’s a list of some of the more popular options for WordPress today:

I’ve compiled the data from some of the top providers so you can get a quick view of how they stack up against each other (be sure to select individual rows or scroll right in the table to see all the details):

Which CDN is Best for WordPress?

Before we get to our recommendation, I should note that lots of managed web hosts include a content delivery network in their offering. For example, Pagely has a product included in all of their plans called the PressCDN. If you have managed hosting already, be sure to check with your provider to make sure you’re taking full advantage. If you have questions about your current setup, hit us up in the comments below and we’ll be happy to help.

In our experience and based on the data above, there are two CDNs we can easily recommend depending on your specific needs.

  1. We recommend Cloudflare for a number of reasons. It’s hard to beat a $0.00 price tag to start, and they have over 152 global data centers. They have a dedicated WordPress plugin and also integrate pretty seamlessly with popular caching plugins like WP Rocket. We also really like that includes some security features out of the box as well. Cloudflare is the CDN we recommend for most people.
  2. If you have more specific needs and require more granular control from a CDN, we’ve been really happy about our results from StackPath. StackPath allows for more ability to fine tune and optimize your web performance, and we’ve found simple tasks like invalidating caches for individual files to be very easy on StackPath too.

In all, we highly recommend all WordPress users take advantage of the performance benefits that a content delivery network can provide. It can be hard to know how our website is performing on the other side of the world, but we have global audiences and want to make the visitor experience as great as we can for everyone.

Final Thoughts

Implementing a CDN will offload some work from your web host, improve website performance around the world, and after the initial setup, it’s a very low-maintenance service that you’ll rarely need to both with.

If you have questions about setup, optimizing your current CDN configuration, or have more specialized needs that we haven’t addressed in the article, leave a comment or send us a note and we’ll be happy to help out.

Enjoy this post? Never miss another one.

1 Comment

  1. Sam Lozano

    Cloudflare is definitely hard to beat, simply because it’s free. The paid ones should definitely consider offering a free trial or something, or somehow proving they’re better than Cloudflare and therefore worth paying for, because why would I choose to pay money for something that I’m already getting for free?

Leave a Reply

You have to agree to the comment policy.