An important aspect to any WordPress site is your WordPress caching. Luckily with WordPress there are some great caching plugins to help with this. Before we get to the plugins lets make sure that we understand the basics of caching and and how it helps to speed up your WordPress website.
A web cache is an information technology for the temporary storage (caching) of web documents, such as HTML pages and images, to reduce bandwidth usage, server load, and perceived page lag. WordPress caching is handled by plugins which range from the very easy to setup such as Comet Cache to the more robust like WP Rocket for higher traffic and more complex website.
Below are the two major types of caching in regards to websites.
Server Caching
Web server caching is more complex but is used in very high traffic sites. A wide range of options are available, beyond the scope of this article. The simplest solutions start with the server caching locally while more complex and involved systems may use multiple caching servers (also known as reverse proxy servers) “in front” of web servers where the WordPress application is actually running. Adding an opcode cache like Opcache to your server will improve PHP’s performance by many times.
Browser Caching
Browser caching can help to reduce server load by reducing the number of requests per page. For example, by setting the correct file headers on files that don’t change (static files like images, CSS, JavaScript etc) browsers will then cache these files on the user’s computer. This technique allows the browser to check to see if files have changed, instead of simply requesting them. The result is your web server can answer many more 304 responses, confirming that a file is unchanged, instead of 200 responses, which require the file to be sent.
Look into HTTP Cache-Control (specifically max-age) and Expires headers, as well as Entity Tags for more information.
WordPress Caching Plugins
Plugins like Comet Cache or WP Rocket for larger sites can be easily installed and will cache your WordPress posts and pages as static files. These static files are then served to users, reducing the processing load on the server. This can improve performance several hundred times over for fairly static pages.
When combined with a system level page cache such as Varnish, this can be quite powerful.
If your posts/pages have a lot of dynamic content configuring caching can be more complex.
Comet Cache
Comet Cache (formerly known as ZenCache) is possibly the easiest to configure of all Caching Plugins. It just works with very little configuration needed and it works well. While there are additional settings you can configure, simply enabling it gives your web site a significant boost after the first time a page has been loaded which causes the page to be created into the Page Cache so that WordPress doesn’t need to ask the Database for the page contents again when the next visitor request the same page.
WP Rocket
WP Rocket is FAST. I had been reading a lot of developers who were claiming how fast it was and I finally had the opportunity to use it. It was everything I’d heard. There’s more configuration than Comet Cache, but still not nearly as much as W3 Total Cache. It is only available as a Premium Plugin, however their pricing is very fair considering the quality of the Plugin.
W3 Total Cache
What was once the king of WordPress Caching, W3 Total Cache has let us down recently. While still possibly the single most powerful Caching Plugin, it’s almost too granular in it’s settings – causing it take a long time to configure.
In addition, some poor decisions about updating the Plugin left a lot of websites in a bad position after a security vulnerability was announced and the security patch that came out had a lot more than just the fix for the vulnerability. There was a significant amount of of new code in it that wasn’t compatible with a lot of sites which in caused a lot of WordPress sites to be broken. This left those site owners in a predicament of leaving a security vulnerability on their site or having a working web site at all.