Speeding up WordPress
Personally, I've come to the conclusion that dynamic websites are the wrong way to go for a blog, but that's the topic of a whole other article. For now, if you want something easy to setup and well supported, WordPress is the dominant player. But how do you make it fast? Before I begin, here are my goals:
- Host a WordPress site that can serve pages in under 2 seconds (even better would be under 1 second) as tested by WebPageTest
- Do this "inexpensively". For me this means on the order of $100-$150/year (or $8-$13/month)
The basic steps are as follows:
- Use a CDN and a fast DNS provider
- Find a fast web host
- Use a caching WordPress plugin
Use a CDN
This one's easy: use CloudFlare. They offer a free tier that provides more than enough features for regular users. They're easy to use and no nonsense. They also provide free DNS hosting, so no need to find a DNS provider. However, if you decide to go a different route and do need a fast and inexpensive DNS provider, NameCheap is on the top 5 of nearly every list I've encountered. I've had very good experience with them, good service, and (as the name suggests) they're very affordable.
Find a fast web host
I've been a long time user of BlueHost. They're very cheap but very feature-full. However, I've always found their performance to be a little lacking and that becomes even more apparent when hosting a WordPress site. After researching many reviews for fast WordPress hosting, I've found the following service providers to be consistently recommended:
- A2 Hosting
Of course if you can afford it, you probably can't go wrong with WPEngine, but in my case I'm just looking for something inexpensive to host my personal blog. I have not yet compared SiteGround or HostGator, but here are my results so far: [table id=1 /] Obviously, these test were run without the use of the CDN to get more accurate results. Here's my experience with some of these solutions:
BlueHost - standard WebHost
As I said, I'm a long-time customer of BlueHost. They have a lot of features at a very reasonable price. They provide ssh access (with a valid ID -- they wanted a scan of my driver's license). And they're one of the few good providers that offers Postgres (which was important to me when I first signed up). However, my WordPress testing has shown they are the slowest of the services I've tested so far. BlueHost did recently offer a CloudHosting solution that is supposed to address this and they now offer optimized WordPress hosting. I have not yet tried this. One thing that rather irked me with BlueHost, however, is if they discover you're in violation of their ToS, they just shutdown your entire account without any warning whatsoever. It's been a number of years since this happened to me, but I found it a bit unfriendly.
DigitalOcean - VPS
If you're familiar with system administration, configuring your own WordPress site is pretty easy. DigitalOcean provides a very inexpensive VPS and is touted for it's performance, pricing, and developer friendly customer service. I've been very happy with their services. Having said that, it is still a bit more work to properly maintain your own system. So it's a question of whether the time or money is worth it to you. I decided to take it a step further by using DigitalOcean with HHVM, the latest open source technology for speeding up PHP sites. This was pretty easy to do, especially with the help of a few nice online resources:
While significantly faster than BlueHost, I was surprised that it still didn't beat out A2 Hosting, even with their cheapest managed WordPress offering.
A2 Hosting - Managed Wordpress
A2 Hosting's advertising department really needs to hire a good designer. Their website looks a bit like a going out of business furniture store, and it's a little non-obvious how to get to their managed WordPress offering and how it differs from their other offerings. Despite this, I found their pricing and customer support was very friendly and responsive. They also clearly cater towards performance in both their marketing and their pricing strategy. You're given numerous upset options, each of which is geared towards eking out even more speed. The nice thing about this is if you ever find ourself in a situation where you're blog is gaining in popularity, you're just an upgrade away from keeping up with your audience base.
A2 Hosting - VPS
A2 Hosting also offers a VPS solution. While they still used CentOS 7.x, they have a bug in their packages that results in many packages not being able to be installed easily, so I never got hhvm installed. I emailed support about this, and they offered a solution. I spent a little time on this, but did not think it was worth the effort. I did however test with Apache, and that's what the results reflect.
In order to keep a fair comparison, I tested all sites using WordPress 4.4.1. I exported my blog from BlueHost and imported them to each of the other sites. In addition, I found that the theme and plugins used can make a huge impact on performance. So I used the FlatBox theme and left the plugins as the default for whichever service I used. (A2 Hosting has some custom optimization plugins they include by default). In addition, I used the W3 Total Cache plugin.
Use a Caching WordPress Plugin
One plugin that's a must is the W3TotalCache plugin. This by itself will make some great improvements to your site. Clearly research like this can go on forever... But for now, I've found a reputable site that meets my criteria. I'll very likely migrate over to A2 Hosting. Although I may give BlueHost's WordPress offering a chance before I do. If that happens, I'll be sure to update this blog.
HHVM prebuilt RPM packages for CentOS 7.x
In case the link above did not work for you, here's the synopsis on installing HHVM on a CentOS system: Add this to your /etc/yum.repo.d/
[debianized] name=debianized packages for Enterprise Linux 7 - \$basearch baseurl=http://repo.debianized.net/centos/7/RPMS/\$basearch enabled=1 gpgcheck=0
yum install hhvm