Share
The subject of the W3 Total Cache plugin has been popping up more and more often in questions from our users of late and we’ve decided to devote some blog posts to covering the basics of this popular and powerful caching solution.
In this second part of our overview series, we’re touching on some of the more advanced options available for its setup.
If you’re coming to this topic for the first time, we recommend starting with our initial article – The Total Beginner’s Guide to W3 Total Cache.
Due to the sheer number of potential server setups out there in the wild, out of necessity we will be sticking to an overview of some of these advanced options as we dive a little deeper, rather than getting into detailed configurations.
Let’s begin with a very brief recap of what was covered in the first article and draw attention to some useful wider resources.
Brief Recap of the Basics
As you explore W3 Total Cache further, it’s worth bookmarking a few references for general information and troubleshooting purposes:
Let’s continue our own guide with a quick look at some of the more advanced minification options on offer.
Minification
Code bloat is an ongoing problem for many sites, and there are two main culprits when it comes to WordPress:
Minification tackles both of these problems by stripping CSS, Javascript and HTML files of all unnecessary information – whitespace and comments for example – in order to reduce their overall file size.
It’s well worth reviewing the Minification sub-section of the W3 Edge FAQ page before starting to explore all the options here.
As we suggested in the previous article, the first step is usually testing the default settings for minification to see what (if anything) breaks. Do this by going to Performance > General Settings > Minify. You’ll typically see the greatest savings here by selecting the disk caching method.
If you do find yourself needing to tweak, then you’ll need to switch the minify mode to manual to fine-tune each option directly from Performance > Minify.
The first thing to notice in the Performance > Minify options is that error reporting is available to help you track down the specifics of any problems you run into.
The second thing to point out is that each of the three options – HTML, Javascript, CSS – can be switched on and off individually to help you troubleshoot with more granularity.
The intricacies of the individual CSS and Javascript options are slightly outside the scope of this overview, but we recommend reviewing Tutsplus’ Advanced Minification Settings article for a more detailed breakdown of the individual options.
You also have the option further down the screen in the Advanced section to get even more specific by disabling minification entirely for chosen pages, Javascript or CSS files or even particular user agents.
With the range of theme and plugin configurations that this module can potentially affect, controlled experimentation is very much the key.
Take advantage of the ability to test items individually and make sure to use the plugin’s import/export options to help document your decisions and dial in the setup that is right for you.
Database Cache
As we noted in the first article, WordPress is a database heavy application.
Many of the calls made will be exactly the same as the site uses, so it makes little sense to be hitting the database time and again if the results of a particular set of queries can be cached.
Database caching enables you to do just this while also being smart enough to know when the information behind the scenes has changed and needs to be served up anew.
W3 Total Cache’s own installation guidelines point out that enabling this option on shared hosting setups may actually be counterproductive, though some hosts such as GoDaddy claim to support it.
Our suggestion is to test in isolation on your own setup to judge its effectiveness.
The types of performance gains on offer here will very much depend on the complexities of your own setup, with the main distinction being whether the information is stored on disk or in-memory with a solution such as APC or Memcached.
The common consensus seems to be that in-memory solutions provide the best results for the database cache.
You can select the database cache method in Performance > General Settings > Database Cache.
Further fine-tuning is then available in Performance > Database Cache.
The main option to pay attention to here is to make sure that Don’t cache queries for logged-in users is selected in order to ensure that normal WordPress functionality continues to work as expected.
The default values for Maximum lifetime of cache objects and Garbage collection interval should be adequate for most setups.
The Never cache the following pages box gives you a handy way of being able to exclude sections of a site if you run into compatibility difficulties with a particular plugin or part of your site.
Object Cache
WordPress ships with a number of object caching options built in for developers to access and make use of.
The general theory here is similar to that of database caching: information associated with WordPress operations can be stored and reused quickly without having to be constantly regenerated.
The first point to notice here is that this is likely to do more harm than good if you find yourself on shared hosting, so unless you are managing your own server setup it is best to ignore this option.
The option can be enabled by going to Performance > General Settings > Object Cache and selecting the Object cache method of your choice.
As with the previous database option, in-memory storage is likely to yield better results here if you have it available to you.
Further tweaking is available via Performance > Object Cache but the default settings here should be more than suitable for the average setup.
Content Delivery Networks
Using a CDN (Content Delivery Network) means offloading the delivery of a certain subset of your content to a company that specializes in getting that content to the user as quickly as possible, regardless of where they are in the world.
They do this by having numerous data centers located strategically around the globe where your content is mirrored and delivered to the user from the location nearest to them.
In the case of WordPress, this would typically involve the delivery of static assets such as image files along with CSS and Javascript files.
CloudFlare and MaxCDN are two of the best known providers in the business and both offer user friendly options for those just starting to get their feet wet with CDNs.
In terms of the backend of W3 Total Cache, there are three general areas to configure in Performance > CDN. Firstly, you need to decide which types of content you will be offloading to the CDN in the General options.
Secondly, you need to establish the connection with the CDN itself via the Configuration panel.
Options here will naturally vary from provider to provider but the good folks over at WPBeginner have an excellent breakdown of how to install MaxCDN with W3 Total Cache that should give you a good idea of the overall process.
The default Advanced settings should work out of the box on most setups, so begin there before starting to tweak.
W3 Total Cache in the Wild
W3 Total Cache has long been used by high-profile sites such as WPBeginner, Matt Cutts, Yoast and StudioPress to get content to users as quickly as possible.
The following links provide some more detailed breakdowns of real-world W3 Total Cache performance that you might find useful when digging deeper into how best to implement it on your own site:
Conclusion
We hope the points above will shed further light on some of the more advanced features of W3 Total Cache and help you make the most of it within the parameters of your own particular setup. Two takeaways:
We’ve introduced most of W3 Total Cache’s functionality so far but we’re curious to hear in which direction you’d like us to take this further.
Is there a particular set of snags you run into again and again? Or a subset of the plugin’s functionality you’d like to see us explore in more detail or just have some questions about Avada? Get in touch in the comments below and let us know!