News You Can Use

The Advanced Guide to W3 Total Cache (WordPress Caching Simplified)

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.

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

Our introduction to W3 Total Cache covered the following areas:

Background on caching in general and the plugin in particular.

Options for installation.

Basic page and browser caching options.

An introductory look at minification.

As you explore W3 Total Cache further, it’s worth bookmarking a few references for general information and troubleshooting purposes:

W3 Edge FAQ: This set of FAQs provides a little more detail, including coverage of technical questions such as, for example, whether to choose opcode caching or memcached. It’s well worth a detailed read before you start integrating on your own site.

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:

CSS: The arrival of CSS frameworks has spared front-end developers a lot of heavy lifting at the expense of substantially increasing the average code base size in themes.

Javascript: An ever improving front and back end feature set in WordPress is increasingly powered by Javascript but at the price of a lot of extra code.

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.

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

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

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:

MyBloggingThing: A good overview of how W3 Total Cache can fit into an overall optimization strategy.

DashboardJunkie: An excellent deep-dive comparison of real-world W3 Total Cache performance as measured against other popular caching solutions.

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:

If you’re managing your own servers – virtual or dedicated – database and object caching both stand to bring major performance increases.

Minification and using a Content Delivery Network are options available to all and should bring significant gains to both you and your users.

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? Get in touch in the comments below and let us know!

8 Comments.

This is certainly a good start for anyone using W3 Total Cache. I think what is missing here and in many other web pages about W3 Total Cache is how to decide or know what “Embed Location” to use for a script.

This is located in PERFORMANCE > MINIFY > JS > JS FILE MANAGEMENT

Google’s Page Speed suggests to Remove render-blocking JavaScripts for improved performance and then the question is what to do with this list in W3 Total Cache.

My research indicates these Javascripts need to be put into the JC File Management area, however, the Embed Location seems to be tricky.

Unfortunately we do not provide support through post comments and W3TC settings vary per server setup, so it would not depend on the theme version, but your server. However, submit a ticket to our team here http://theme-fusion.com/support-ticket/ and they can check it out for you.

Blog Tags

Social Profiles

Did You Know

The purchase you made allows you to use Avada on one domain. A single purchase is needed for each site you use Avada on. We appreciate everyone following the rules as it allows us to keep supporting and releasing new updates.

Have An Idea For Avada?

ThemeFusion

We are ThemeFusion, a creative and dedicated group of individuals. In 2012 we set out to make the perfect theme and Avada was born. Since then it has been the #1 selling theme with an ever growing user base of 350,000+ wonderful customers. We believe Avada will change your outlook on what a Wordpress theme can do.

Insert/edit link

Before You Post On The Forum …

To help speed along your request, we require that you follow the steps below before posting a new topic on the forum. This is for the benefit of everyone and will help make the entire forum more efficient. It's very important and we ask that everyone who posts follow these steps.

Step 1 – Always check the Documentation and the Knowledgebase Section. Most questions can be answered in those areas.

Step 2 – Always perform a Forum Search before you post, its very possible your issue has already been brought up and has been answered.

Step 3 – If your question has not been brought up, then please post a new topic. Always include: your site URL, detailed information about the issue, possible screenshots of the issue. To help speed the process up, quickly post a second reply and include your WP and FTP login info and be sure to check the “set as private reply” checkbox so only our team will see.

Step 4 – Patiently wait! We strive to get you answers as quickly as possible. Do not BUMP your thread, it will take 2X as long to get a reply because we answer threads from old to new.

Step 5 – Lets All Be Civil. The vast majority of users are very helpful, patient and kind, and so are we. We greatly appreciate this type of behavior. If posts are ever made that fall outside of this realm, we will remove them and could possibly remove the user account. So lets all be happy people.