WordPress Caching: What Does Each Option Do
WordPress has a number of different types of caching that can be used to speed up the front-end and back-end (wp-admin) load times.
Object Cache Pro (a business class Redis object cache backend for WordPress)
All sites on Nexcess come with Object Cache Pro plugin (a business class Redis object cache backend for WordPress) enabled by default.
Redis object caching will improve sites’ slow queries since the second request will come directly to Redis, and the slow query will not have to hit MySQL. Redis object caching can be cleared in two spots directly under the Nexcess logo in the admin bar as well as from:
Settings > Object Cache > Flush Cache
Redis object caching should be used together with a full-page caching plugin since they are two types of caching that work together on your site.
Full Page Caching
Nexcess provides a forked version of the Cache Enabler plugin that is designed for the platform.
Full-page caching is where a static HTML version of pages and posts on your would-be served out when a user requests to view a page or post on your site. Full-page caching improves the front-end load time on your site since each page request does not have to hit have the content rendered out from the database using PHP. Cache Enabler will be able to bypass hitting PHP directly to serve out the static HTML version. You can clear the cache created by Cache Enabler directly from the admin bar of your site.
Autoptimize for Minification of CSS & JavaScript Assets
A solid plugin for the minification of CSS and JavaScript assets loading from your site from the active theme and active plugins is the Autoptimize plugin.
You can install the Autoptimize plugin either using the Nexcess installer in wp-admin or as a new plugin in wp-admin. The Autoptimize plugin will not do anything by default. When you activate the plugin you will need to enable the CSS and JavaScript minification settings and then save you can access the settings from this menu item:
Settings > Autoptimize
With the advent of HTTP/2 and HTTP/3 minification of theme and plugin assets in must real-world uses is helpful for your site’s load times.
Content Delivery Network (CDN)
Nexcess provides its own CDN to improve the asset loading time on your site. Using a CDN will help the assets load time for users on your site if you have site audiences that are spread out from the location of your datacenter. The Nexcess CDN will work with a number of plugins such as CDN Enabler and WP Rocket.
Combined Caching
All of the caching methods can be used together on your site since each method is for a different type of caching. It is recommended that you use Redis object caching, full-page caching, minification, and a CDN to improve the front-end load times of your site.
Related Articles
- How to Customize the Nexcess MAPPS MU (Must-Use) Plugin
- Enabling Redis Object Caching
- What is Redis Cache? Redis Cache Explained Simply