Number 1 WordPress Caching Recommendation
Sarah J By - Sarah J

Number 1 WordPress Caching Recommendation

To get the best speed out of your WordPress website you need to use some sort of caching. We’ll walk through a few WordPress caching options below.

What is WordPress Caching

Caching simply means to store something away. For instance, in my house, we have a chocolate cache that I can take refuge in whenever (daily) I feel the cravings.

In computing terms, caching means to store data in a way that’s more quickly accessible for repeat requests than its original storage. Ok, that’s a mouthful so let’s take a look at the WordPress process.

When a user requests a page on your site, the web server passes that request to PHP.

PHP passes the request to WordPress.

WordPress starts building the page and passes requests for data to the database, MySQL.

Once WordPress has all the data it builds the page and sends it back to the user.

This can take a really long time in computing terms. The theme and any plugins used may also not be coded efficiently making each request take a fairly long time.

With a WordPress caching plugin what happens is that the first time a page is accessed, this entire slow process is followed: Server->PHP->Wordpress->MySQL->Web Browser.

But, once the complete page is built up it’s stored as a complete page in a folder, usually wp-content/cache/sub-folder.

The next time that someone access that same page, if it exists in the cache it will be sent directly to the user without the heavy processing work of building the page, ie, Server->Web Browser.

Not all caching is the same

Before we start talking about actual WordPress caching plugins lets understand how caching happens. Above, I alluded to the fact that caches are stored as static files in a folder. This is usually the case but not always true.

It is possible to store cache directly in RAM (memory). This is the fastest way of accessing data. Its many many times faster than disk cache.

Over and above that, to get to the cache you may still invoke PHP which invokes WordPress which loads up the whole WordPress eco-system. This is fairly “expensive”. The only saving is in the last part, getting data and building the page.

To truly benefit from your cache you want to:

a) Store it in RAM (memory)

b) Not invoke PHP / WordPress at all.

With your Optimised WordPress hosting plan you get the best caching setup possible. We mount the wp-content/cache folder in RAM. So while it looks and acts like a regular file system it’s blazingly fast because it’s stored in memory.

We also have Nginx rules in place for the most popular caching plugins so that when your WordPress site pages are stored in the RAM cache Nginx will serve up the static pages on subsequent requests directly, thereby avoiding PHP/Wordpress and MySQL altogether.

That makes for a super-fast cache and a super-fast, Optimised WordPress site,

Recommended Caching Plugins

Here are the caching plugins we recommend:

W3 Total Cache

W3 Total cache is a fantastic plugin which we’ve often used and still use. It generates an Nginx config file which we include if its present and this allows Nginx to serve static pages when they’re available.

WP Super Cache

WP Super Cache is written by Automattic. Because we use W3 Total Cache and WP Dev Cache (below) a lot we don’t have major experience with WP Super Cache, other than to say it does come highly rated.

WP Dev Cache

WP Dev Cache is a WordPress caching plugin built by us. As its name implies its really a caching plugin for theme and plugin developers. Its claim to fame is that it handles fragment caching very well. For instance, if you have parts of a page you want to cache independently then this is a great option. For example, if your page displays current local weather and below that, a list of the top ten outdoors restaurants then its quite likely that the top ten list won’t change daily, whereas the weather will.

Using WP Dev Cache you could cache the top ten restaurants for a much longer time than you cache the weather.

Our WordPress Caching Plugin Recommendation

Our recommendation to optimise your WordPress site through the use of a caching plugin is still with W3 Total Cache. Its a well built, well-used plugin and because it generates an Nginx config file which is used in our RAM cache you get the most bang for your buck.

What do you use?

Please let us know in the comments which WordPress caching plugin you use.



Leave a Comment

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