Ultimate Guide to WordPress Performance

Let’s make WordPress faaaaaast. We’ll start simple, and then move to optimizations most articles don’t talk about. Studies have shown each second can change the conversion rate by 7%.

 

The Basics

These are some big wins that are must-haves for any website.

Install a caching plugin

There are lots of good ones. The simplest one is called “Breeze”. Breeze strives to be a one-click solution that auto-detects the best optimizations and applies them. If Breeze causes any problems with your website, you can also try WP Super Cache, W3 Total cache, or WP Rocket. They are all equally good.

Optimize Images

You want to both downsize and compress all of your images. Ewww Image Optimizer and Smush It are two good plugins for this.

Use a CDN

This will cause your website to be loaded from a server close to your user. This is especially good for international users. ClouFlare will perform additional performance optimizations, and is often touted as being the best CDN to use, but these optimizations are best performed by your caching plugin. I would still recommend CloudFlare as it is free, but any CDN will do.

Have a good Host

Trust me. A webhost like WP-SecureHosting.com that cares about speed is worth a few extra dollars per month.

 

Server-side Improvements

These are the items you will want to look for when finding a good webhost. Bigger hosting companies are often slower to implement these items.

Server-side caching

There are two common server-side caching mechanisms. Varnish and LiteCache. You will want to use these in addition to your caching plugin. Caching plugins will perform optimizations such as minification, that server-side caching programs do not do. Server-side caching programs have a super-fast in-memory cache. So the best solution is to use both a WordPress caching plugin, and use a webhost that supports server-side caching. Note that there is some additional setup to make sure the server-side cache is flushed each time your WordPress caching plugin flushes its cache. The Breeze plugin will auto-detect if Varnish is installed, and WP-Rocket has a checkbox that can be checked if Varnish is installed. Also note that LiteSpeed is an alternative to Apache. LiteCache runs on LiteSpeed servers (there is also an open source version of LiteCache for Apache). Not all LiteSpeed servers come with LiteCache, so if you see a webhost advertising LiteSpeed support, make sure they also support LiteCache.

HTTP/2

Released in 2015, HTTP/2 is a must have. It is faster in many ways. QUIC is an alternative to TCP that will further speed things up. If you can find a webhost that offers HTTP/2+QUIC, let me know in the comments below. SPDY is Google’s old attempt at making the web faster, but it has been superceded by HTTP/2. Google has moved on to using HTTP/2 instead.

Railgun

Cloudflare offers a service called Railgun, but this has to be installed by your webhost to work. Your webhost also needs to be a partner of Cloudflare. Railgun speeds up communication between your server and Cloudflare’s servers by only sending data that has changed since the last time your website was loaded.

PHP 7 or HHVM

The difference between PHP 7 and the previous version (version 5.6, they skipped version 6) is incredible. Before PHP 7 came out Facebook created their own optimized version of PHP called HHVM, but PHP 7 is now slightly faster than HHVM. Either way, as long as you’re not using PHP 5.6, you should be good.

IOPS

Most web-hosts advertise the fact that they are using SSD drives, but then they limit your IO speed. This is fine as you don’t want someone else on the server maxing out the hard-drive, but the true metric you want to look for is the IOPS benchmark. IOPS stands for “Input/output operations per second”. The next best metric is the read/write MB/s speed, but this measures the read/write speed of sequential data which is not that representative of what the hard-drive does when it loads a website. Either way the point is don’t get fooled into thinking that an SSD drive is something wonderful to have on a hosting plan, unless you’re using a dedicated server.

Memory

Server-side caching uses a lot of memory, so you will need a web-host that isn’t frisky on how much memory you get. You will want a minimum of half a GB, and ideally you will want a full GB. If you often have more than 5 users loading your site at once, you may need more memory. Solutions like New Relic can monitor how close you are getting to maxing out your memory.

Up-to-date MySQL/MariaDB

You’ll want to make sure your webhost frequently updates MySQL as updates come out. MySQL updates will often include performance improvements. MariaDB is a fork of MySQL and is supported by WordPress. You may find old articles referring to MariaDB being faster, but this is no longer true. (MariaDB used to use a faster DB engine called XtraDB, but all of the improvements in this DB engine have been merged into the InnoDB engine that ships with MySQL and MariaDB.)

 

Understanding your Caching Settings

Coming soon. This section will talk about common WordPress caching settings.

 

Misc Improvements

InnoDB

If you’re database is still using a MyISAM engine, you’ll want to convert your database tables to use an InnoDB engine.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.