You are here: Home » WordPress Tutorial » W3 Total Cache Settings – Configure & Optimize Your Website

W3 Total Cache Settings – Configure & Optimize Your Website

What is “W3 Total Cache”

W3 Total Cache is a speed optimization plugin which can improve your visitor’s experience by increasing the speed of your WordPress site. It is among the most famous and widely used cache plugins for WordPress sites. This post covers all aspects related to w3 total cache regarding the importance of cache plugins, alternatives, properly configuring W3 Total Cache settings for maximum web page optimization. By the end of the post, your site will be much faster than earlier.

Why Do I Need A Cache Plugin & Why Website Speed Is So Important?


You need a cache plugin to increase your website speed. The speed of the website is essential for a better experience for visitors and SERP. Search Engines like Google measure the website’s speed in ranking it in search results. A faster website is more likely to rank above the slow site. Although site speed is not the only factor for the ranking but surely it is among the important ones. Here

What are other alternatives to W3TC?


If you want to try the other cache plugins before using W3TC, here are some real alternatives:

See More: Test Your New WordPress Theme Without Activating It

Why W3TC is best among all cache plugins?


  1. As stated by W3TC team, w3 total cache plugin can increase your site speed up to ten times.
  2. Used by many big companies like mashable.com, makeuseof.com, kiss925.com.
  3. Recommended by many hosting companies including Host Gator, Media Temple.
  4. Offers so many features in a single window like page cache, browser cache, minify which others plugins do not provide.
  5. Most importantly, when I personally used both WP super cache & w3 total cache, my site’s speed was much faster with w3 total cache.

Here is a performance report generated of this site from gtmetrix

w3 total cache settings

Installing W3 Total Cache


(Uninstall other cache plugin if you have one installed earlier)

Install w3 total cache the same way as you install other WordPress plugins. Download the plugin, upload it and activate it. Anyhow if you do not know, here are the quick steps:
1). Download the plugin
2). Upload it through : Plugins -> Add New -> Upload -> Choose File -> Install.
3). Activate the plugin : Plugins -> Installed Plugins -> Activate (w3 total cache).

Configuring W3 Total Cache Settings?


W3 total cache configuration could be a bit confusing if you are a WordPress beginner or using this plugin for the first time. To make things easier for you, I have included the XML/PHP File containing all the w3 total cache settings.

You can simply import all the settings by uploading the file via Performance -> General Settings -> Import / Export Settings (at the bottom). Still, here are all the settings step by step:

1. W3TC General Settings

  • Page Cache – Enabled
  • Page Cache Method – Disk Enhanced
  • Minify – Enable
  • Minify Mode – Auto
  • Database Cache – Enabled
  • Database Cache Method – Disk
  • Object Cache – Enable
  • Object Cache Method – Disk
  • Browser Cache – Enable
  • CDN – Enable if you are using a CDN service else Disable
  • Enable varnish cache purging – Disable
  • New Relic – Enable if you use New Relic else Disable
  • License – Fill your license key if you are using a premium account
  • Enable Google Page Speed – Disable else enable with verified key
  • Verify rewrite rules – Enable
  • Enable File Locking – Disable
  • Optimize disk enhanced page – Disable
  • Debug – No Changes

2. Page Cache Settings

Page Cache – General

  • Cache Front page – Check
  • Cache feeds: site, categories, tags, comments – Check (Blogs running Feedburner – Uncheck)
  • Cache SSL (https) requests – Check
  • Cache URLs with query string variables – Uncheck
  • Cache 404 (not found) pages – Uncheck
  • Cache requests only for yoursite.com hostname – Check
  • Don’t cache pages for logged in users – Check
  • Don’t cache pages for following user roles – As per your choice

Page Cache – Cache Preload

  • Automatically Prime the Page Cache – Checked
  • Update Interval – 900
  • Pages per interval -10
  • Sitemap URL – URL of your blog’s xml sitemap. E.g. http://example.com/sitemap.xml
  • Preload the post cache upon publish events.

Page Cache – Purge Policy

No changes

Page Cache – Advanced

No Changes

3. W3TC Minify Settings

Minify can increase your site speed by removing the unnecessary comments and spaces from your Html source files. Please keep in mind that this function may cause a crash of your site sometimes. I would recommend you to consult your hosting provider before using this function.

Minify Settings – General, HTML & XML

  • Rewrite URL structure – Check
  • Disable minify for logged in users

Minify Settings – HTML and XML

  • Enable – Check
  • Inline CSS minification – Check
  • Inline JS minification – Check
  • Don’t minify feeds – Check
  • Line break removal – Uncheck

Minify Settings – JS & CSS

  • JS minify settings – Check
  • Operation in area – Minify
  • Embed Type – Non-blocking using defer
  • All other options – Uncheck
  • CSS minify settings – Enable
  • Combine only – Disable
  • Preserved comment removal – Disable
  • Line break removal – Enable
  • @import Handling – Process

Minify Settings – Advanced

No change

4. W3TC Database Cache

  • General – Don’t cache queries for logged in users – Enable
  • Advanced – No Changes

5. W3TC Object Cache

No changes

6. W3TC Browser Cache

Browser Cache – General Settings

  • Set Last-Modified header – Check
  • Set expires header – Check
  • Set cache control header – Check
  • Set entity tag (eTag) – Check
  • Set W3 Total Cache header – Check
  • Enable HTTP (Gzip) compression – Check
  • Prevent caching of objects after settings change – Uncheck
  • Don’t cache cookies for static files – Uncheck
  • Do not process 404 errors – Uncheck

Browser Cache – CSS & JS

  • Set Last-Modified header – Check
  • Set expires header – Check
  • Expires header lifetime – 3153600 seconds
  • Set cache control header – Check
  • Cache Control Policy: cache with max-age and validation
  • Set entity tag (eTag) – Uncheck
  • Set W3 Total Cache header – Check
  • Enable HTTP (Gzip) compression – Check
  • Prevent caching of objects after settings change – Disable
  • Disable cookies for static files – Check

Browser Cache – HTML and XML

  • Set Last-Modified header – Check
  • Set expires header – Check
  • Expires header lifetime – 3600 seconds
  • Set cache control header – Check
  • Cache Control Policy: cache with max-age and validation
  • Set entity tag (eTag) – Check
  • Set W3 Total Cache header – Check
  • Enable HTTP (Gzip) compression – Check

Browser Cache – Media and other files

  • Set Last-Modified header – Check
  • Set expires header – Enable
  • Expires header lifetime – 31536000 seconds
  • Set cache control header – Enable
  • Cache Control Policy – cache with max-age and validation
  • Set the entity tag (eTag) – Check
  • Set W3 Total Cache header – Enable
  • Enable HTTP (gzip) compression – Enable
  • Prevent caching of objects after settings change – Disable
  • Disable cookies for static files – Check

7. W3TC User Agents Group & Referer Groups

No changes

8. W3TC CDN (For CDN users only)

These settings are only for the users who use CDN services like MaxCdn or Cloudflare on their website. If you do not want to spend money on CDN services, you can also try some free CDN available for WordPress blogs.

  • Host attachments – Check
  • Host wp-includes/ files – Check
  • Host theme files – Check
  • Host minified CSS and JS files – Check
  • Host custom files – Check
  • Import external media library attachments – Uncheck
  • Add canonical header – Uncheck

After configuring all the settings, Go back to General Settings & Hit Empty all Cache. Finally, you are done and have successfully configured w3 total cache optimal settings on your blog.

SEE ALSO: Important Settings After Installing WordPress

Check if the plugin is configured and optimized correctly?


If you have followed all the above steps, the plugin will be configured correctly.

To check if the plugin is working correctly, open the Html source code of any web page of your website (Right Click -> View Source) and look for this line:

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/ -->

to confirm its proper working. To confirm the speed optimization of your website after installing this plugin; Go to Pingdom Tools and check the speed of your website once again. My website’s speed jumped to 91% from 39% earlier. I am sure that it will be increased for yours too.

What Else


Sometimes a wrong host can also contribute towards slow speed of your site. So it is crucial that you also choose some best WordPress based hosting along with cache plugin.

Do let me know what increase you got to your website. If you face any issues, feel free to reach me anytime.

Editorial Staff at Web Loggerz is a team of Web Technology lovers led by Ansh Gupta.

31 Comments

  1. Thanks Rauzet. Best wishes.

  2. Thanks Toqeer

  3. Sorry about that. Please check now. Its PHP file with all necessary configuration settings. Do let me know if you need to know anything else.

    • Welcome Mike.

  4. One of the most comprehensive and best guides I found on the net! Thanx brother :D

    • Thanks Aditya

  5. Thanks alot. Am using the settings now on my blog. Keep up the good work.

  6. thank you for the write up. the included settings file really helped!

  7. I used your simple tutorial to set up this plugin in all of my sites. I don’t need an explanation of why, I just need to know what to select so I can be done. Thanks again!~

  8. Thank you very much. Your site was a big help for me.

  9. Thanks, I am now started using it on my blog. Hope it work and speed up my site.

    • It surely will Akash.
      If you face any trouble, just let me know.

    • Thanks for your reply. Okay than I’ll now started using this on my blog.

  10. Hey! Thanks so much for the handy guide – I was just wondering which of the major webhosts you would recommend to work with w3? Dreamhost?

  11. Hi,

    Under ‘General Settings’, you recommend selecting manual minify mode. What exactly has to be manually added when this is selected?

    Thanks,

    Adam

    • I guess few of the options have been changed in the latest version. I will update it accordingly. Thanks for letting me know.

  12. Hey mate!
    I was firstly using wp super cache and suddenly came across your blog and tried installing and configuring W3 cache. Believe me my pingdom test increased from 66 to 83 and my Google page speed increased from 68 to 83.
    Feeling Great, Thanks again :)

  13. Recently I had an issue with my slider (Theia Post Slider). Where the styles for the buttons weren’t loading. I tried every possible permutation and combination. But this worked – Minify – CSS – Enable (Uncheck). I was hoping there is another way around it.

  14. W3 Total Cache Settings – Configure & Optimize Your Website is a great and very good ideas that can make us feel so enjoying reading like this great article …this is very good and so interesting i like it so much ..really thanks so much for sharing this with us i like it a lot …

  15. Total cache is the best plugin to use if you want to speed up your site. The best performance it will be also if you connect it to a CDN.

  16. Hi Ansh,
    You made it very simple for me. I want to use w3 total cache for my blog. Thanks a lot.

  17. Hi Ansh,

    Thanks for your guide. I was wondering though, what about the security vulnerabilities that this plug-in had and that many people complained about? I know that happened already some time ago and I assume the plug-in´s author already fixed those issues but I´d like to be sure before installing it.

    • I think this issue was already fixed in the last version update.

  18. Great article,after reading i’ve re-install w3 total cache for my blog. thanks for such great information.

  19. My Yslow grade is higher than the Google pagespeed grade. Why so?

  20. Awesome settings! My new blog is loading tremendously fast. Thanks for it!

  21. I was firstly using wp super cache and suddenly came across your blog and tried installing and configuring W3 cache. Believe me my pingdom test increased from 66 to 80 and my Google page speed increased from 68 to 88.

  22. Thanks Ansh for your excellent w3 total cache settings tutorial
    the page load speed of my blog was improved, fast! fast! fast!

  23. Thank you for taking the time to do this. A few of the written selections above are different than what the 0.php install file brings in. For example in the JS Minify settings you wrote “Embed Type – Non-blocking using defer” but the import file has “Non-Blocking using JS”. There were some differences in Browser cache as well. I am wondering which is the latest and correct method to use? Thank you.

  24. I adjusted the settings as you suggest. However, the source code it did not. I would appreciate if you can help. Thank you.

  25. Please help me ! This code does not appear on my website

Leave a Reply

Your email address will not be published. Required fields are marked *