{"id":2319,"date":"2016-08-16T14:17:21","date_gmt":"2016-08-16T14:17:21","guid":{"rendered":"https:\/\/conflated.co.za\/2016\/08\/16\/the-ultimate-guide-to-w3-total-cache-how-to-set-it-up\/"},"modified":"2019-11-09T17:16:21","modified_gmt":"2019-11-09T17:16:21","slug":"the-ultimate-guide-to-w3-total-cache-how-to-set-it-up","status":"publish","type":"post","link":"https:\/\/conflated.co.za\/the-ultimate-guide-to-w3-total-cache-how-to-set-it-up\/","title":{"rendered":"The Ultimate Guide to W3 Total Cache: How to Set it Up"},"content":{"rendered":"
Setting up W3 Total Cache can be overwhelming. The popular and powerful caching plugin has 16 menus to contend with and offers a dizzying array of options to configure. However, get through all of them and a significant boost in website performance awaits you.<\/p>\n
This post is the second installment in a four-part series about W3 Total Cache<\/a> (W3TC).<\/p>\n In this post we\u2019ll walk through each of W3TC\u2019s 16 menus one at a time, and explore all of the configuration options available in W3TC. Once you\u2019ve finished this post you\u2019ll be ready to tackle setting up W3TC like a pro.<\/p>\n <\/p>\n We will never take money to promote others, everything you read is genuine. Learn more.<\/a><\/p>\n<\/div>\n <\/p>\n W3TC is in the WordPress Plugin Directory so installation is super simple. Access the plugin installation menu by going to Plugins > Add New<\/strong> in the WordPress admin dashboard. Then search for \u201cW3 Total Cache,\u201d find the plugin from the list of available options, and select Install Now<\/strong>.<\/p>\n After installation, activate the plugin, and you\u2019ll see Performance<\/strong> added as a new top-level item in the admin menu. Select Performance<\/strong> and you\u2019ll be taken to the W3TC Dashboard<\/strong> and you\u2019ll see a list of W3TC menu items that includes the following pages:<\/p>\n Let\u2019s walk through each menu in order.<\/p>\n The primary purpose of the Dashboard<\/strong> is to serve as a place to clear the various caching modules, check compatibility between the plugin and server, and monitor server performance.<\/p>\n The first item displayed on the Dashboard<\/strong> is a series of buttons.<\/p>\n Many of these functions can also be completed from any page of your website by accessing the Performance<\/strong> menu item from the admin menu bar at the top of the page.<\/p>\n The information generated by the compatibility check<\/strong> button can be very helpful. It will test your server configuration for support of all W3TC features. Review the results and you\u2019ll know what features you can enable and what features will require additional server configuration work to be supported.<\/p>\n If you\u2019re setting up W3TC for the first time, click the compatibility check<\/strong> button so that you know which features you will and won\u2019t be able to implement.<\/p>\n Below the row of buttons you\u2019ll find a few additional sections:<\/p>\n All of these sections are optional and do not affect website optimization.<\/p>\n The General Settings<\/strong> menu is the most important W3TC menu. All of the caching options offered by W3TC are enabled and disabled from this menu and then refined by adjusting settings at subsequent menus.<\/p>\n First, take a look at the list of link at the top of the page.<\/p>\n Each of these links connects directly to a section further down on the General Settings<\/strong> menu. Clicking on them just saves you some scrolling.<\/p>\n It is common for first-time W3TC user to confuse these links and the W3TC menu items in the admin menu. It\u2019s important to realize that the links in the admin menu go to different menu pages entirely where features are refined. The links at the top of the page link to sections of the General Settings<\/strong> menu where these features are enabled or disabled.<\/p>\n Below the list of links is the General<\/strong> panel. There are two options in this panel:<\/p>\n Selecting the checkbox to Toggle all caching types on or off (at once) <\/strong>is not usually a good idea and tends to produce admin notice overload.<\/p>\n 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, enabling only those that you actually plan on using.<\/p>\n Preview mode is a valuable tool built into W3TC, but it does take some getting used to.<\/p>\n Enable Preview Mode<\/em> if you\u2019re adjusting W3TC settings on a live website. Once enabled, a dialog will be displayed at the top of the screen letting you know that any changes made won\u2019t affect user experience unless you select the button to deploy<\/em> the changes.<\/p>\n What preview mode does is create a seperate container for site settings. Any changes made to W3TC settings with preview mode enabled are saved separately from the deployed settings. This lets you work with W3TC settings without affecting user experience.<\/p>\n With preview mode enabled, you will see three buttons:<\/p>\n After selecting Preview<\/em> and refreshing the window the button will change to Stop previewing<\/em>. Select Stop previewing<\/em> to view the site as visitors see it while they aren\u2019t logged in.<\/p>\n Take the time to get comfortable with preview mode. Some of the changes that W3TC can make to your site \u2014 most notably, minification of CSS and JavaScript \u2014 can break your site. Playing with those settings on a public-facing site is a really bad idea. With preview mode enabled, you can work on those settings without displaying the results until you\u2019re happy with them.<\/p>\n One type of admin notice you will see on an ongoing basis while working with W3TC is a recommendation to clear the cache.<\/p>\n What this notice is telling you is that changes you\u2019ve made have invalidated the version of site resources in the cache.<\/p>\n Anytime you see an admin notice adiving you to clear cached data, select the button to empty the relevant cache.<\/strong><\/p>\n The next section in the General Settings<\/strong> is the Page Cache<\/strong>. This is arguably the most important feature offered by W3TC. If you do nothing but enable page caching you should see a measurable boost in site performance. Thankfully, it\u2019s also easy to set up.<\/p>\n W3TC can use a variety of different caching methods to cache static copies of your sites pages and posts (all referred to generically as pages<\/em> by W3TC). The default choice in most cases should be the Disk: Enhanced<\/em> method. However, shared server users may have to use Disk: Basic<\/em> instead if their host complains of excessive resource usage or if the compatibility check test reveals that the server is not compatible with enhanced disk caching.<\/p>\n Dedicated or virtual private server users can opt for one of the Opcode cache methods. If you manage the server yourself, you can install<\/a> the opcode cache method you prefer. If your server is a Windows machine you\u2019ll need to go with Opcode: WinCache<\/em> instead.<\/p>\n Memcache is designed for use in multi-server hosting environments. As a result, it may be available if you\u2019re using cloud-based hosting and even from some shared hosting providers. If it\u2019s available in your hosting environment, use it.<\/p>\n With your preferred page caching method selected \u2013 most likely Disk: Enhanced<\/strong>\u00a0\u2013 select Save all changes<\/strong>.<\/p>\n Note: Minification of CSS and JavaScript can also be done with Hummingbird<\/a>. If you use Hummingbird for minification, leave this option disabled in W3TC.<\/strong><\/p>\n Minification of JavaScript and CSS can break sites, whether you\u2019re using W3TC or another plugin. So proceed with caution when enabling the Minify<\/strong> module.<\/p>\n The Auto<\/strong> option will combine and minify all JavaScript and CSS resources. However, selecting it means that you won\u2019t be able to work with each resource individuall from the Minify<\/strong><\/a> menu. The only way to know how things will go is to try Auto<\/strong>, fine tune the settings in the Minify<\/strong> menu, and see how your site loads. If doing this breaks your site, switch to Manual<\/strong>.<\/p>\n Select Disk<\/strong> caching method if you use shared hosting. Otherwise, select the same caching method as you selected for the page cache method.<\/p>\n If your site is on a shared server leave database caching disabled<\/a>. Database caching is a resource intensive process. Unless your server is powerful enough to handle the processing and storage load, database caching may actually slow down your site rather than speed it up.<\/p>\n Database caching is simple to set up. Just select Enable<\/strong> and match the method to the caching method you\u2019ve been using so far.<\/p>\n You have to think about the bottlenecks that can affect website performance to understand why database caching can slow down your site. If the process of querying the database is slowing down your site, then database caching can speed up your site by reducing the number of times the database has to be queried. However, if a lack of server memory is slowing down your site, then asking the server to cache the database give an overloaded server more work to do and slows it down further.<\/p>\n So, how do you know whether or not database caching should be enabled?<\/p>\n Object caching is built into the WordPress core. The Object Cache<\/strong> module caches objects from the Object Cache API<\/a> to cut down on the number of complex database queries performed by the server. Like database caching, object caching is easy to set up, but may or may not actually help the performance of your website.<\/p>\n Object caching has the greatest potential to help highly dynamic sites \u2014 BuddyPress sites, bbPress sites, and so forth \u2014 hosted from a private environment. If you\u2019re running a blog or business website from a shared server, you can give it a try but are almost certainly better off leaving it disabled.<\/p>\n To enable object caching select the Enable<\/strong> checkbox and matching the caching method to the method you\u2019ve been using thus far.<\/p>\n Note: Browser caching can also be accomplished with Hummingbird<\/a>. If you use Hummingbird for browser caching leave this option disabled in W3TC.<\/strong><\/p>\n Enabling browser caching is as easy as selecting a single checkbox and clicking Save all changes<\/strong>.<\/p>\n With browser caching enabled, website resources will be cached by website visitor browsers. That way, when a page is viewed a second time it can be loaded from the browser cache.<\/p>\n If you use a content delivery network (CDN) you can integrate your CDN service with W3TC. This will mirror cached files from your web server to the CDN so that you have the full benefit of both caching and distributed content delivery.<\/p>\n To enable CDN integration select the Enable<\/strong> checkbox, pick your CDN service provider from the list of CDN types, and click Save all settings<\/strong>.<\/p>\n You will also need to visit the CDN<\/a><\/strong> menu to add your CDN credentials to W3TC before integration between W3TC and the CDN will be complete.<\/p>\n You will may notice that Cloudflare is absent from the list of CDN services. To use Cloudflare with W3TC visit the Extensions<\/a> menu, activate the Cloudflare extension, and then navigate back to the General Settings<\/strong> menu to complete Cloudflare integration.<\/p>\n To use this option you will need to install Varnish<\/a> on your server and go through some advanced server configuration steps. This is only the sort of thing you will want to do if you are hosting in a private environment with root access to the server. If you are interested in setting up varnish to work with W3TC, Tuts Plus has a tutorial<\/a> that walks through the process.<\/p>\n New Relic server monitoring can be integrated with W3TC. To use this service you have to install<\/a> New Relic on the server and sign up for a New Relic account. Since New Relic has to be installed on the server, it isn\u2019t compatible with shared hosting.<\/p>\n If New Relic is installed on your server and you have a New Relic account, enter your account credentials in this section to add server statistics to your W3TC Dashboard<\/strong>.<\/p>\n The first option in the Miscellaneous<\/strong> section in the General Settings<\/strong> is used to enable a Google PageSpeed widget in the W3TC dashboard. To do this you will need to first set up an API key.<\/p>\n In most cases, you will want to leave all of the other settings in the Miscellaneous<\/strong> section alone.<\/p>\n Debug Mode<\/strong> should remain disabled unless you are actively using it.<\/p>\n With the debug mode enabled, debugging information will be added at the very end of the page source.<\/p>\n It\u2019s worth noting that only the cache modules that are enabled in the General Settings<\/strong> menu will be available in Debug Mode<\/strong>. In the image above you can see that only Page Cache<\/strong> and Minify<\/strong> are available. This is because the other cache features were disabled at the time the image was captured.<\/p>\n If you use W3TC on a number of sites and want to duplicate plugin settings between multiple sites, this section will make that easy.<\/p>\n Select Download<\/strong> to export the current settings. Then use the Choose File<\/strong> option on another site to upload the same configuration. You can also use this option to create a backup file to use as a restore point when configuring W3TC.<\/p>\n Lastly, if you want a fresh start configuring W3TC, the option to Restore Default Settings<\/strong> will let you do that.<\/p>\n With page caching enabled from the General Settings<\/strong> menu, use the Page Cache<\/strong> menu to fine tune page caching behavior.<\/p>\n When selecting pages to cache be as inclusive<\/strong> as possible. In most cases, you will want to cache virtually all pages.<\/p>\n If you site resolves using https, then you will want to enable Cache SSL (https) request<\/strong>s<\/em>.<\/p>\n Most sites will not benefit from selecting Cache URIs with query string variables<\/strong>. Enabling this option can produce unexpected results by caching unanticipated strings. So, unless your site search feature is used heavily for searching the same terms, leave this option disabled.<\/p>\n Finally, it is not advisable to cache 404 pages. Visitors shouldn\u2019t see them very often anyway, and you don\u2019t want Google to index a 4040 page as a regular page which can happen if you enable this option.<\/p>\n The next option, Cache requests only for (your domain) site address<\/strong> is left unchecked by default, but the universal recommendation is to check this option.<\/p>\n The next two options look quite similar but the fine print explanation provided under each makes it clear that they are quite different.<\/p>\n It\u2019s not usually a good idea to obscure the cached version of the site away from logged in admins who may inadvertently change the cached version without realizing it. So you should leave the section option unchecked.<\/p>\n The next section, Cache Preload<\/strong>, is used to build the page cache before the pages are accessed.<\/p>\n It\u2019s a good idea to select the option to Automatically prime the page cache<\/strong>. The default update interval and pages per interval values are good presets for shared servers. However, if you have a more powerful hosting environment feel free to reduce the update interval and cache pages in larger batches.<\/p>\n You will want to add a Sitemap URL<\/strong> to the appropriate field as W3TC will use the sitemap to identify the pages that should be cached.<\/p>\n Lastly, in most cases you\u2019ll want to select the option to Preload the post cache upon publish events<\/strong>. This will ensure that the cached version of your posts page is updated every time you publish a new post.<\/p>\n The Purge Policy\u00a0<\/strong>section is used to specify the pages to purge from the page cache whenever a post is published, edited, or commented on.<\/p>\n You will probably want to leave the \n
This article is 100% affiliate-free!<\/h4>\n
Setting Up W3 Total Cache<\/h3>\n
\n
Dashboard<\/h3>\n
<\/div>\n
\n
<\/div>\n
Compatibility Test<\/h4>\n
<\/div>\n
Dashboard: Support, Marketing Offers, PageSpeed, and Server Monitoring<\/h4>\n
\n
General Settings<\/h3>\n
<\/div>\n
General Settings: General<\/h4>\n
<\/div>\n
<\/div>\n
General Settings: Preview Mode<\/h4>\n
<\/div>\n
\n
Clear the Cache<\/h4>\n
<\/div>\n
General Settings: Page Cache<\/h4>\n
<\/div>\n
General Settings: Minify<\/h4>\n
<\/div>\n
General Settings: Database Cache<\/h4>\n
<\/div>\n
\n
General Settings: Object Cache<\/h4>\n
<\/div>\n
General Settings: Browser Cache<\/h4>\n
<\/div>\n
General Settings: CDN<\/h4>\n
<\/div>\n
General Settings: Reverse Proxy<\/h4>\n
General Settings: Monitoring<\/h4>\n
General Settings: Miscellaneous<\/h4>\n
<\/div>\n
\n
General Settings: Debug<\/h4>\n
<\/div>\n
General Settings: Import\/Export Settings<\/h4>\n
<\/div>\n
Page Cache<\/h3>\n
<\/div>\n
<\/div>\n
\n
<\/div>\n
<\/div>\n