Best Settings to work with W3 Total Cache

Written by Tushar. Posted in Blogging

Caching is always a must have for all wordpress based blogs. Caching improves loading speed of wordpress based blogs. In the post Caching in WordPress improves loading Speed, I mentioned about the importance and need for caching. For WordPress blogs, W3 Total cache and WP Super Cache works best.

W3 Total Cache

W3 Total Cache comes with various options to configure and its really easy to configure it. W3 Total Cache is a combination of page caching, browser caching, database caching, object caching, minifying, CDN integration. This tutorial is aimed for the new bloggers and the settings here in tutorial are tested on shared hosting.

W3 Total Cache Installation

  • Deactivate any other caching plugin, if you are using.
  • From the wordpress admin section install and activate the “W3 Total Cache.”
  • Now there will be an option on sidebar labeled “Performance”, which is actually W3 Total Caching settings menu.

W3 Total Cache

  • Now you need to disable the preview mode. You can do this by pressing the “Disable” button where it says “Preview mode is active:”

W3 Total Cache

General Settings

This is the first page where you need to enable or disable various settings. After enabling/ disabling from General Settings, we will move to detailed settings.

W3 Total Cache

Now moving further to various sections of General settings.

Page Cache

  • Enable the Page Cache
  • Set “Disk:Enhanced” in Page Cache method.

W3 Total Cache

 Minify

  • Enable the Minify
  • Select “Auto” for Minify mode.
  • Set “Disk” for Minify Cache method.
  • Let the HTML minifier be kept as “Default.”
  • Set “JSMin” in JS Minifier.
  • Let the CSS minifier be kept as “Default.”

W3 Total Cache

 Database Cache

  • Enable it
  • Set “Disk” in Database Cache Method.

W3 Total Cache

Object Cache

  • Enable it
  • Set Object Cache Method to “Disk”

W3 Total Cache

Browser Cache

This is one of the important caching method because with this browser stores the pages you visit. Next time when you visit the same page, browser will only check the changes in the page therefore making less request to server. Also the time taking contents like scripts and images are stored in the browser. This caching method certainly improves loading speed.

  • Enable it.

W3 Total Cache

Above settings are basic settings of the W3 Total Cache and now if you have CDN then you can enable the CDN settings. After CDN settings section you will find out two more settings to make “Cloudflare” and “Varnish,” both of these are third party applications.  As this article is intended for new bloggers I am not discussing the details of CDN, Cloudflare and Varnish.

Miscellaneous

  • In this section enable Verify rewrite rules and also enable “Google Page Speed Dashboard widget.” You can get the “Page Speed API key” from the link “APIs Console” displayed under.

W3 Total Cache

Page Cache detailed settings

The “page cache” page is divided into various sections, General, Advanced, Cache Preload and Purge Policy.

General Section

In this section select the following only.

  1. Cache Home Page
  2. Cache Feeds: site, categories, tags, comments
  3. Cache request only for xxx.com hostname
  4. Don’t cache pages for logged in users.

Advanced Section

Leave it to default settings and set the “Garbage collection interval” to 3600 seconds.

Cache Preload Section

In this section do the following.

  1. check the Automatically prime the page cache option.
  2. Set update interval to 900 seconds
  3. Set pages per interval to 10.
  4. Paste the sitemap URL.

Purge Policy Section

Leave it untouched to have default settings.

Minify Detailed settings

This settings page is also divided into several sections. Follow the instruction below.

General Section

  •  Check the “Rewrite URL structure” option.
  • leave the “Disable minify for the logged in users” unchecked.
  • Set “Minify error notification” to disabled.

HTML & XML

  • In “HTML minify settings” check the “Enable”, “Inline CSS minification”, “Inline JS minification” options only. Rest leave as it is.

JS

  • In this section only select the “Enable” option and leave rest unchecked.

CSS

  • In this section only select “Enable” option and leave rest unchecked.

Advanced

  • Set “Update external files every” to 21600 seconds.
  • Set “Garbage collection interval” to 21600 seconds.

Database Cache and Object Cache detailed settings

These two section doesn’t need to be edited, the default settings work fine for me. So I recommend to keep the settings default.

Browser Cache detailed settings

As I said earlier this is the most important settings of W3 Total Cache plugin.

General section

  • Only enable set Last-Modified header, set expires header, set cache control header, set W3 Total Cache header and enable HTTP (gzip) compression.

CSS & JSS

  • Enable set Last-Modified header, set expires header, set cache control header, set W3 Total Cache header and enable HTTP (gzip) compression.
  • Set “Expires header lifetime” to 31536000 seconds.
  • Set “Cache Control Policy” to “cache with max-age”

HTML & XML

  • Enable set Last-Modified header, set expires header, set cache control header, set W3 Total Cache header and enable HTTP (gzip) compression.
  • Set “Expires header lifetime” to 7200 seconds.
  • Set “Cache Control Policy” to “cache with max-age”

Media & Other Files

  • Enable set Last-Modified header, set expires header, set cache control header, set W3 Total Cache header and enable HTTP (gzip) compression.
  • Set “Expires header lifetime” to 31536000 seconds.
  • Set “Cache Control Policy” to “cache with max-age”

Above settings are intended for new bloggers and will discuss the Cloudflare, Varnish and CDN settings in coming days. These basic settings work great on shared hosting, while more advance optimization through this plugin can be achieved while using VPS and Dedicated server hosting.

If by chance you don’t feel any improvement in loading speed of your blog then try to disable minify and object cache. Sometimes enabling minify and object cache settings can hamper your blog performance using W3 Total Cache.

Always check the Google Page Speed score from Dashboard. Page Score of more than “80” is needed to consider a blog being optimized in good way. Alternatively you can check both YSlow and Page Speed scores using GTmetrix.

Tags:

Tushar

If you like this post then follow on Twitter and Facebook. If you have any query then contact the author.

Comments (8)

  • Tristan

    |

    thank your very much ! very helpfull

    Reply

  • G Kamal

    |

    Wow,really awesome best about w3 total cache plugin Bro..

    Reply

  • spazlport.com

    |

    For shared hosting i leave object caching and database caching off unless you have over thousands of articles then i would turn those caching settings on, even then always should ask and make sure with your hosting provider if they support that type of caching because instead of speeding up the site you will either crash it or make it slower then it is.

    Reply

    • Tushar

      |

      Thanx for the info.

      Reply

  • Elfyf

    |

    Thanks for writing this tutorial on how to setup and decrease a blog load time using W3 total cache.

    I applied your tuts on one of my site and there is a huge improvement on speed load.

    I test it with GTMetrix, Pingdom tools and Page speed, all three gave me awesome result.

    Reply

Leave a comment