Page Speed is the major factor for the good ranking and the better reader experience in the current scenario. Everyone wants the page loads faster. In WordPress, There are many factors which slow your site speed down such as dynamic PHP scripts, static content like CSS, js, Html. Every time when a visitor come to your site, WordPress has to connect to the database to process the request. This increases server resources and makes your site slower. If you are on shared hosting server, It is very important to use cache plugin for your WordPress site to save your resources and for fast loading time. There are two cache plugin in WordPress – Wp Super Cache and W3 Total Cache. Here we discuss how to optimizing WordPress with W3 Total Cache plugin.

This tutorial is a beginner’s guide to setup W3 Total Cache. We cover all of important setting of W3 Total Cache here.

How to Install W3 total cache:

First install the W3 Total Cache from your WordPress dashboard and activate it. If you are using any cache plugin like super cache or other WordPress cache plugin uninstall it. You can install it manually by downloading here and upload to your server. for detail please read How to install plugin in WordPress.

Settings and Configuration of W3 Total Cache:

W3 total cache plugin comes with tons of options, wrong configuration of cache plugin makes your site worst and slower. So we will cover every setting of cache plugin. After activated the plugin, Go to Performance>General setting. Here you can enable or disable all option at once by check the box Toggle all caching looks like below image.

General Settings

w3total cache general setting

w3-total-cache-general-page-setting

This is the ideal setting for individual options:

  • Enable Page Cache, use “Disk: Enhanced”, better for the shared server. If you are on dedicated server then you can also select Opcode: Alternative PHP Cache as it’s the best.
  • Enable Minify, set it to “manual”. you can use automatic, but it embed the all CSS and js files in <head> section which creates the problem for above the fold page render. manual gives you the option in minify setting page to choose where to embed the file. Use “Disk”.
  • Enable Database Caching. Use: “Disk”. Not recommended if you are on shared server with limited resources.
  • Enable Object Caching. Use: “Disk”. It’s great for sites with heavy traffic, but in most cases it slows down the WordPress admin dashboard. If facing slow dashboard, So not recommended disable it.
  • Enable Browser Cache. Most Recommended. It helps in leveraging browser caching and reduce server load.
  • Enable CDN if use Max CDN or listed. If use Cloudflare activate it from Performance>Extention>Cloudflare.
  • Enable Verify rewrite rules, if you have a Google Page speed API, then you can enable Dashboard Widget.

For shared server with less resources, only Page Cache, Minify Cache and Browser Cache are Important.

Now we setup the Individual setting for each cache method. Go to Performance>Page Cache.

W3 Total Cache settings For Page Cache

Page Stting w3total cache

This is the ideal caching for page cache. you can choose different according to your requirement.

  • Enable Cache front page.
  • Enable Cache feeds: site, categories, tags, comments.
  • Enable Cache SSL (https) requests. If use SSL.
  • Enable Cache requests only for www.yoursitename.com hostname.
  • Enable Don’t cache pages for logged in users.
  • Enable Don’t cache for user roles.

For Cache Preload

preload-cache

W3 total cache caches a page when it is first requested. Cache Preload caches the page before first request and just after publishing the post. When a visitor requests the page first time, the page is served in the lowest possible time.

  • Enable Automatically prime the page cache. Ideal update interval as 905 seconds (you can choose different) or something close. Select number of pages 10 (increase or decrease depending on hosting).
  • Enter your sitemap URL. And enable Prime post cache on publish.

For Advanced

page-advance-setting

This is the ideal setting for Advance page cache. Enabling compatibility mode may increase your CPU Usage. If facing problem, uncheck it.

  • Set Garbage collection interval: 86400
  • Set Comment cookie lifetime: 1800

 W3 Total Cache settings for Minify.

Now go to Performance>Minify. In General setting:

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

For HTML & XML

minify-setting

  • Check on enable, inline CSS minification, inline JS minification and line break removal(optional).

For JS

If choose the automatic on the General setting page in above second step, there is nothing to do here. But we recommended you to choose manual minification, It gives you the option to where embed.

js-minify-setting

  • Check the box Enable, preserved comment removal.
  • line break removal may stop some functionality of other plugin.
  • Choose Embed type Non-blocking using “async” (Recommended) for all of the areas.
  • Now got to the source of your site as before and find those js files which are hosted on your website. The best option is to test your site with page speed insights. Now add their URLs one by one and check every time whether something is breaking your site or not. Keep most of the files embed before </body>. If gives any error try to </head> section.
  • Customscript.js and the themes js files like themename.js may give you the errors.

For CSS

CSS-mininfy

  • check the box enable, preserved comment removal and line break removal.
  • Now go to your website in the browser and right click and view source.
  • Find the CSS files, and add their URLs one by one in the CSS minification box.

For Advanced

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

W3 Total cache settings for Browser cache

browser-cache

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

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.
  • Set cache control policy: Cache with Max-age.

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 User agent groups:

Don’t change anything. Only Enable.

W3 Total Cache Extention:

This plugin provides you an interface with some extensions. If you use CloudFlare for serving your static files. you can activate it from here. after activation you can enable or disable CloudFlare setting from your WordPress dashboard. You can configure w3 total cache with WordPress Seo by Yoast Plugin, Feedburner, and Genesis Framework.

These are the Ideal setting for W3 total cache. you may use different according to your requirement. we try to cover all aspects. if you have any query leave the comment in comment box.

Pin It on Pinterest

Shares
Share This