The Perfect Guide to W3 Total Cache Settings

This Post is mainly written for WordPress users who host their websites on WordPress.We have so many performance optimization plugins for WordPress like WP-Super cache, Hyper Cache, DB-Cache Reloaded Fix etc. But here we only discuss about W3 Total Cache because it had more useful options compared with other performance optimization plug-ins. So we plan to cover all important settings of W3 Total Cache plug in.Before knowing about these settings first you need to know why we use this plug in. In terms of Google Webpage loading is the main metric to rank that website,because no one wants to wait so much time in any website. There are different ways to speed up a website. Here are few of them like Caching, database caching, object caching, minifying. The main reason behind choosing W3 Total Cache plugin is it have all these settings at one place.

W3 Total Cache Primary settings :

First of all install W3 Total Cache plugin from plugin section and activate it.

Now after activation you need to deactivate the Preview mode. To deactivate it , just click on plugin and click on Disable button to disable preview mode.

disable preview in w3 total cache

Now we will do the rest of the process step wise.

General Settings:

Enable Page Cache, use “Disk : Enhanced”. If it’s showing up in your options then you can also select Opcode : Alternative PHP cache.

enable page cache in wordpress

 

Enable Minify, set it to “manual”. If you set it to “Auto” then it show error message. So use Manual only. Use “Disk”. If it’s showing up then you can also select Opcode : Alternative PHP cache.

enable minify mode
Enable Database Caching, use : “Disk”. If your wp-config is not writable due to some security plugin then set it to writable for optimal working of Database Cache.

enable database cache in wordpressEnable Object Caching, Use : “Disk”. This option is very useful for sites which have heavy traffic.

enable object cache

Enable Browser Cache, It helps in leveraging browser caching.

enable browser cache
Enable Verify rewrite rules, and if you have a Google Page speed API, then it’s your choice to enable Dashboard Widget.
Optionally you can enable “Optimize disk enhanced page and minify disk caching for NFS“. It helps on some shared hosting setups.

Advanced settings:

  • W3 Total Cache settings For Page Cache:
  • Enable Cache front page.
  • Enable Cache feeds: site, categories, tags, comments.
  • Enable Cache SSL (https) requests.
  • Enable Cache requests only for www.yoursitename.com host name.
  • Enable Don’t cache pages for logged in users.
  • For Cache Preload
  • Enable Automatically prime the page cache. Set update interval as 907 seconds or something close. Select number of pages 15 (increase or decrease depending on hosting).
  • Enter your sitemap URL. And enable Prime post cache on publish.

For Advanced

  • Set Maximum lifetime of cache objects: 180060 seconds.
  • Set Garbage collection interval: 3600 seconds.
  • W3 Total cache settings for Browser cache
  • Enable set Last-Modified header, set expires header, set cache control header, set W3 Total Cache header and enable HTTP (gzip) compression.
  • Set all the cache control policies to : Cache with Max-age.

For CSS & JS

  • Set expires header lifetime : 31536000 seconds (over 1 year).
  • Enable set Last-Modified header, set expires header, set cache control header, set W3 Total Cache header and enable HTTP (gzip) compression.

For HTML & XML

  • Set expires header lifetime : 7200 seconds.
  • Enable set Last-Modified header, set expires header, set cache control header, set W3 Total Cache header and enable HTTP (gzip) compression.

For Media and other files

  • Set expires header lifetime : 31536000 seconds.
  • Enable set Last-Modified header, set expires header, set cache control header, set W3 Total Cache header and enable HTTP (gzip) compression.

W3 Total Cache settings for Minify :

  • Enable rewrite URL structure and disable minify for logged in users. Set error notification to Admin notification.

For HTML & XML

  • Tick on enable, inline CSS minification, inline JS minification and line break removal.

For CSS

  • Tick enable, preserved comment removal and line break removal. Now go to your website in some other browser and right-click and view source. Find the CSS files, and add their urls one by one in the CSS minification box. Do this to see whether something breaks the layout on minification or not.

For Advanced

  • Update external files every : 216000 seconds and same for garbage collection.

For JS

  • This is the most difficult part of setting up W3 total cache settings. It requires some trial and error. Do it if the above steps were not enough.
  • Tick on enable, preserved comment removal and line break removal. Now got to the source of your site as before and find only those js files which are hosted on your website. Now add their urls one by one and check every time whether something is breaking your site or not.

NOTE :

Customscript.js and the themes js files like themename.js should not be minified as mostly they are the ones which cause errors.

W3 Total Cache settings for User agent groups

  • Just enable it and don’t change anything.

NOTE :

If any setting is not there in this guide then leave it to the default value.

Checking the cache

Open any other browser and clear its cache and then open your homepage URL. Now right click and click on “View Page Source” and at the bottom, it should look like the screenshot below

page source code to check page cache
Go to tools.pingdom.com and check your site load time. If everything is working well. You can expect results like below.

alltechbuzz speed test

If the Optimal Settings do not work for you. Follow these steps :

  1. You can try WP-Super cache. And learn to customize it here. Using it along with DB-Cache reloaded fix will give you nice results. But not better.
  2. Disable Gzip compression and see if it works well.

Still you have problems with W3 Total Cache Settings then leave a comment with your problem, we will try to fix those problems.

About Imran

Imran Uddin is the founder of All Tech Buzz, a popular tech blog dedicated for Geeks and Bloggers. You can follow me on Facebook or you can connect with me on Twitter @Imran_ATB, Follow me on Google Plus

Email: [email protected] - Services

Comments

  1. Thanks for informing me about such a gr8 plugin ! Will get it as soon as my blog gets moved to wrodpress

  2. bro I want to guest post on your blog! what are the requirements?

  3. Thanks for providing this good information bro. This will definitely help me in boosting up my blog speed.

  4. Hi Immran,

    W3 total cache is a great plugin, It help you to speed up your website and reduce a load time by catching a page. You can also connect your cloudflare account with it to gain more speed. This plugin rocks and have many great functionality…. :)

  5. imran this is very useful post thnx for the publish …. can you have write a post for free CDN service.

  6. Thanks for this Imran, can you write on Yoast Plugin as well, I confused with other articles that is been written by different people. Thanks – MV

  7. Thank for sharing this awesome tips.
    Do you also use this plugin ??
    and do you use such as CDN service to optimize ur site?
    thanks

  8. bro…
    In W3 Total Cache settings for Minify
    In Advance Settings
    No able to set garbage collection to value 216000.

  9. Getting 2.6 seconds loading time after doing all the settings. Can you please check it? Here is the URL – http://winappleworld.com/

    Following up this comment so I can hear from you.

  10. Hello Raman – I am using this Plugin currently and noticed few settings was not similar to what you had mentioned and I have currently adjusted my settings based on this tutorial. Thanks for sharing.

Speak Your Mind

*