Setting up W3 Total Cache can be tiring. This popular caching plugin has 16 menus to contend with and offers a dizzying array of options to configure. However, going through each one is a significant boost to a website's performance.

This tutorial is the second part of a series of tutorials about W3 Total Cache (W3TC).

In this tutorial, which will be done in several chapters, we will go through the 16 menus of W3TC, and explore all the configuration options available in W3TC. Once you've completed these tutorials, you'll be ready to tackle W3TC setup like a pro.

Configuring W3 Total Cache

W3TC is available in the directory of WordPress plugins, therefore its installation is simple. We have written a tutorial on how to install a WordPress Plugin. You will have no trouble installing W3TC.

After installation, activate the plugin, and you will see " Performance Added as a new top-level item in the dashboard menu.

w3tc performance plugin menu

Select "Performance" and you will be taken to the W3TC Dashboard and you will see a list of W3TC items. So we'll go through each element:

1 - Dashboard

The main purpose of the dashboard is to serve as a place where you can clear different caching modules, check compatibility between the plugin and the server, and monitor server performance.

The first item displayed on the dashboard is a series of buttons, which allow you to do several things:

W3TC cache plugin button

  • Compatibility check: Server tests to determine which functions can be enabled.
  • Empty the caches: Deletes all cached resources.
  • Empty only the cache memcached (s): Deletes all cached resources using the memcached method.
  • Empty only the opcode cache: Removes all resources cached using one of the opcode cache methods.
  • Empty only the disk cache (s): Deletes all cached resources using the disc.
  • Update of the "Media Query String": W3TC attaches a string to the end of the media resources (CSS, JS, and image files). Click this button to update this string to ensure that browsers download an updated version of these resources.

Many of these features can also be accessed from any page of your dashboard.

Accessible menu WordPress W3TC

About the compatibility test

The information generated by the compatibility check can be very useful. This feature will allow you to test your server configuration with all W3TC features. Review the results and you'll know what features you can enable and what features require something more.

WordPress compatibility test W3TC

If you're setting up W3TC for the first time, click the Compatibility Check button so you know what features you'll be able to put together.

Dashboard: Support, Marketing Offers, PageSpeed ​​and " Server Monitoring »

Below the row of buttons you will find some additional sections:

  • Premium Services: Allow you to take a help desk.
  • Spread The Word: Allows you to share W3TC on social media, add a note to the plugin on WordPress.org and add a link to W3 EDGE to the footer of your site.
  • Registration on MaxCDN.
  • Monitoring servers New Relic And follow-up with Google Insights PageSpeed.

Note that additional configuration is required in the general settings and the menu " Monitoring »Where a key PageSpeed ​​API, as well as the creation of the account and the installation of " New Relic“, Are necessary to activate these features.

All of these sections are optional and do not affect website optimization.

2 - General Settings

The “General Settings” menu is the most important menu in W3TC. All of the caching options offered by W3TC are toggled on and off from this menu, then refined in subsequent menus.

First, take a look at the list of links at the top of the page.

general-settings-w3 total Cache

Each of these links connects directly to a lower section on the menu. General Settings ". Clicking on them will save you a lot of scrolling.

It is common for W3TC users to confuse these links and the W3TC menu items in the dashboard menu. It is important to realize that the links in the dashboard menu lead to different pages where the features are refined. The links at the top of the page lead to the menu sections " General Settings Where these functions are enabled or disabled.

General Settings: General

Below, you will find the list of links in the panel « general ". There are two options in this panel:

General panel W3TC cache WordPress plugin

Selecting the checkbox to enable / disable all types of caching (at once), which is usually not a good idea and tends to produce an overload.

notification W3TC

Very few sites will actually use all of the caching modules, so it makes more sense to go through the caching options one at a time, making it easier to judge which one you want to use.

General Settings - Preview mode

Preview mode is a valuable tool built into W3TC, but it takes a while to be mastered.

Activate "Preview" mode if you are doing W3TC configurations live on a website. Once enabled, a dialog box will appear at the top of the screen letting you know that the changes made will not affect the user experience unless you select the button to apply those changes.

Mode preview W3TC plugin WordPress

What preview mode does is create a separate container for site settings. Changes made to W3TC settings with preview mode are saved separately from those already deployed. This allows you to manipulate W3TC settings without affecting the user experience.

With the preview mode enabled, you will see three buttons:

  • deactivate : Disables preview mode and deploys all changes and backups in my preview.
  • Deploy : Applies changes made and saved in preview mode to the live site, but keeps the preview mode enabled.
  • Preview : Launches a new browser window where you can see the results of the changes made without affecting the visitor experience (these settings will only apply to you).

After selecting " Preview »(Preview) and refreshes the window; the button will change to " Stop Preview ". Select " Stop Preview To view the site as visitors see it, when they are not connected.

Take the time to familiarize yourself with the preview mode. Some of the changes on W3TC (in particular, minification of CSS and JavaScript files) Can make your site unavailable.

Dealing with these live settings with equally active traffic is a very bad idea. With the preview mode enabled, you can work on these settings without viewing the results until you are satisfied with their results.

Clear Cache

One type of notification that you will be used to seeing is the invitation to delete cache.

delete the cached W3TC WordPress plugin

What these notifications mean is that the changes you made invalidate all cached content.

So every time you are asked to empty the cache, do it.

General Settings: Cache Page

The next section in " General settings " is the " Page Cache ". This is probably the most important feature offered by W3TC. If you do nothing but turn on page caching, you should see a measurable boost in your site's performance. Fortunately, it is also easy to set up.

Page caching W3TC WordPress cache plugin

W3TC may use various caching methods to cache static copies of your site pages and articles (all referred to generically as "pages" by W3TC).

The default choice in most cases should be: " Disk: Enhanced ". However, shared server users may have to use " Disk: Basic If their host complains about excessive resource usage or if the compatibility check test reveals that the server is not compatible with hard disk caching hardening.

Dedicated or Virtual Private Server users can opt for one of the caching methods " opcode ". If you are managing the server yourself, you can install the cache method " opcode " that you prefer. If your server is a Windows machine, you will need to choose " Opcode: WinCache ».

« Memcache Is designed for use in multi-server hosting environments. As a result, it may be available if you are using ' Cloud And even some shared hosting providers. If it is available in your hosting environment, you will be able to use it.

With your preferred method of caching selected pages, you must now save your settings.

General Settings: Minify

Minification of JavaScript and CSS files can break sites, if you use W3TC or another plugin. You must therefore proceed with caution when activating the module " Minify ».

W3TC minify WordPress cache plugin

The option " Cars Combines and shrinks all JavaScript and CSS resources. However, selecting this means that you will not be able to work with each menu of the " Minify ". The only way to know how things will behave is to try “Auto”, fine-tune the settings in the “Minify” menu, and see how your site loads. If you do and your site looks bad, use the manual method.

Select the caching method " Disk If you use shared hosting. Otherwise, select the same caching method you selected for the " Page Cache ».

General Settings: Database Cache

If your site is on a shared server, then database caching is disabled. Caching the database is a resource heavy process. Unless your server is powerful enough to handle processing and storage, the cached database can actually slow down your site rather than speed it up.

A cached database is easy to set up. Just select "Enable" and choose the method you want to apply to this caching.

W3TC caching

You need to think about bottlenecks that can affect website performance to understand why cached database can slow down your site.

If the database querying process slows down your site, then the cached database can speed up your site by reducing the number of times the database will be queried.

However, if a lack of server memory is slowing down your site, then asking the server to cache the database gives a server an overload of work to do, which slows it down further.

So how do you know whether or not database caching should be enabled?

If your site is hosted on a shared server, it will be best to disable this feature.

If your site has resources - like on a VPS or a dedicated server - then you can test the caching of the database. You'll also be able to test to make sure that when caching is enabled, the site is faster.

General settings: Object cache

Object caching is built into the WordPress core. The object cache module caches API objects to reduce the number of complex requests to the database made by the server. Just as the database can be cached, object caching is also easy to set up, but it may or may not actually help improve the performance of your website.

Caching WordPress objects

Caching objects has the greatest potential to help essentially dynamic sites (BuddyPress of sites, site bbPress) hosted in a private environment. If you use a blog or website from a shared server, you can try it, but in these environments the ideal is to leave it disabled.

To enable object caching, select the " Enable "(Enable) and the caching method you use so far.

General Settings: Browser Cache

Browser cache activation is as easy as selecting a single check box by clicking "Save All Changes" (Save All Settings).

Browser caching

With browser caching enabled, website resources will be cached by visitors' browsers. This way, when a page is displayed a second time, these resources will be loaded from the browser cache.

General Settings: CDN

If you use a content distribution network (CDN) you can integrate your CDN service with W3TC. This will mirror your web server's cached files so that you have the benefit of both services: caching and delivering the distributed content (CDN).

To activate CDN integration, select the " Enable », Choose your CDN service provider from the list of CDNs, then click on« Save all settings "(Save all settings).

Configuration CDN W3TC

You will also need to visit the CDN menu to add your CDN credentials to W3TC, in order for this to work properly.

You may notice that Cloudflare is missing from the list of CDN services. To use Cloudflare, you must add a W3TC extension. Access the menu « Extensions ", Activate the Cloudflare extension, then return to the" General Settings To complete the CloudFlare integration.

General parameters: "Reverse Proxy"

To use this option, you must install " Varnish On your server and go through advanced server configuration steps. This is only the kind of thing you need to do if you host your blog in a private environment with access root On the server. If you are interested in setting up ' Varnish So that it works with W3TC, Tuts More (en anglais) offers a tutorial on it.

General Settings: Monitoring

« New Relic »Control service, can be integrated with W3TC. To use this service, you must install " New Relic On the server and create an account « New Relic ". Given that " New Relic Must be installed on the server, it is not compatible with shared hosting.

If New Relic is installed on your server and you have a new account « Relic Enter your credentials in this section to add server statistics to your W3TC dashboard.

General settings: Miscellaneous

The first option in the " Others In the General Settings is used to activate the widget " Google PageSpeed ”In the W3TC dashboard. To do so, you will first need to set up an API key.

miscelleanous settings W3TC

In most cases, you will not want to configure these options.

Check that the rewrite rules option is checked by default. Uncheck to prevent W3TC from letting you know that there is something wrong with your write rules configuration.

« Enable file locking "(Enable file locking) is disabled by default. Locking files is not compatible with most shared hosting. However, on private hosting, you can enable it and see if it improves your site's performance.

« Optimize disk enhanced page " and " minify disk caching for NFS Are disabled by default. It's an option that can provide a modest boost to your site's performance.

« Enable Edge Mode Must be disabled on production sites. However, if you want to test this caching feature in a test environment, select this option.

General Settings: Debug

Debug Mode must remain disabled unless you are actively using it.

debug mode W3TC

With debug mode enabled, debug information will be added at the end of the page source.

It is interesting to note that only cache modules that are enabled in the menu of " general settings Will be available in Debug mode. In the image above you can see that only " Page Cache " and " Minify " are available. This is because other caching features were disabled at the time the image was captured.

General settings: Export / import settings

If you use W3TC on a number of sites and want to apply the same options everywhere, this feature will be very useful.

import and export settings

Select " Download To export the current settings. Then use the option Choose File On another site to download the same configuration. You can also use this option to create a backup file to use as a restore point when configuring W3TC.

We will stop here for this tutorial. We will continue in a next one. Remember that we are exploring the different features of W3TC.

This list of meta boxes have a summary of the features that are (in their full version) available in the menu « Performance ».

Do you have any questions so far? Do not hesitate to ask us.