We show unabashed favoritism and profess our love for a piece of software. You lose all confidence in our sanity and wonder why you’re reading this document at all.
WordPress is our best friend. We can (and do) use it to power 90% of the sites we build. With the right technology stack, it’s as fast as any ‘enterprise’ toolset. Kept up to date, it’s secure (we’ve never had an up-to-date WordPress install hacked). The CMS is easy to use.
So yes, we’re biased. That’s why we’ve written an entire post just about optimizing WordPress.
W3 Total Cache for WordPress
We work on a lot of WordPress sites and our caching plugin of choice is W3 Total Cache (W3TC). This plugin offers a full suite of caching options as well as integrations with New Relic and popular CDN services. W3TC modules include browser, page, database, and object caching. It also has minification options, user-agent detection and redirection, performance monitoring, and much more.
It is a very powerful plugin that addresses many of our site speed recommendations, including leveraging browser caching with expire headers, resource minification, gzip compression, and CDN-based recommendations including parallelized downloading across domains.
It is important to configure W3TC to fit the needs of your application, but we have put together a starting guide of recommendations.
Who Is This Plugin For?
We recommend W3TC for WordPress sites that are using general hosting solutions. The usefulness of this plugin diminishes in managed WordPress hosting environments such as WPEngine, Pagely, Pantheon, etc.
On the General Settings tab, enable Page Cache, Minify (auto), Object Cache, and Browser Cache. If you have a CDN, enable that as well. For each of these settings, use the best caching method available. If you are on a shared server environment, you may only have the options for Disk: Basic and Disk: Enhanced. If so, use Disk: Enhanced. If you are in a dedicated/virtual environment, ideally you have more advanced opcode options like OpCache/APC or XCache. If any of these are available, be sure to utilize them.
Page cache will keep entire pages of your site in local cache, reducing response time. Enable these options in WordPress under Performance > Page Cache > General.
Object caching helps further reduce the execution time of commonly called operations. Enable this option and use the default values provided.
Browser caching utilizes a user’s web browser to store site resources for increased page load times and reduced server load. W3TC can generate these directives for you. Enable these options in WordPress under Performance > Browser Cache.
Configuring your CDN usually involves creating and selecting a pull zone, entering the authorization key, and defining one or many CNAME hostnames. When you define (and setup) multiple CNAME hostnames, you are essentially utilizing parallelized resource downloading. W3TC is equipped to handle this.
Turning on CDN options does not automatically connect your site to a CDN. The plugin supports a range of CDN services but an account with one will need to be established to set it up.
A big Autoptimize honors dependencies set when using the wp_enqueue_script and wp_enqueue_style functions. Having dependencies for scripts and styles properly set reduces the amount of errors and collisions that can happen when CSS and JS files are combined.
Should you turn Autoptimize on in WordPress be sure to stick around for some testing. While the plugin is good at keeping things in order, combining and deferring scripts and styles is a big operation.
Turning on ‘Optimize CSS Code?’ and ‘Aggregate CSS-files?’ will crunch down the size and amount of CSS delivered when a page loads. However, the real benefit here is the ‘Inline and defer CSS?” setting. Keep in mind that while this option will get your CSS files out of the way, Critical CSS will need to be present to prevent the ‘flash of unstyled content’ that happens when CSS loads after content.
Autoptimize offers a service that will create Critical CSS automatically if you have the money to spend on a turn-key service.
Overall we view Autoptimize and W3TC as two pieces of a single solution for improving load times. Autoptimize is more specific and serves one a few specific needs. However, when it comes to W3TC you may need all of what it does or possibly one feature. If you host your site on a managed wordpress host it is likely that you don’t need W3TC at all.