Home Hosting Checklist and Best Practices to Setup W3 Total Cache Plugin for WordPress

Checklist and Best Practices to Setup W3 Total Cache Plugin for WordPress

Checklist and Best Practices to Setup W3 Total Cache Plugin for WordPress

If you are looking for a checklist and best practices to set up W3 Total Cache Plugin for WordPress sites, check out our guide below.

Related: How to Setup Cloudflare Cache for WordPress

W3 Total Cache has over a million active installations and is one of the recommended plugins to have. It offers complete control over various optimizations at a granular level, unlike most cache plugins. It helps advanced users and developers to make various optimization combinations to get the desired results.

W3 Total Cache is the greatest comprehensive plugin that does exactly what it says- Improves the performance of a site using multiple-stage caching.

Popular websites that use W3TC are:

  • WpBeginner
  • SitePoint

Why W3TC is a best Caching plugin?

The implementation of flexibility, cutting-edge feature, and broad range of support makes it the best plugin.

Overview:

Pros:

  • Cutting-edge features and flexibility are amazing—5/5 for performance.
  • Found compatible with Cloudflare, Varnish, and more.

Cons:

  • Lots of settings may confuse beginners, but the same make the plugin extremely flexible.

Before proceeding with following steps, make sure to disable every other caching plugin. Moreover, it is recommended to prevent the use of numerous caching plugins at WordPress.

Installation & Setup process:

  1. First of all, login to WordPress Dashboard example.com/wp-admin/
  2. Now follow the below path: Plugins > Add new > Search for W3 Total Cache
  3. Now install and Activate
  4. Go to Settings > General
  5. Click on Hide button to discard following header message.
  6. Preview mode: Don’t touch
  7. Enable Page Cache > Choose Page Cache Method > Disk Basic
  8. Minify: Don’t touch.
  9. OpCode Cache: Don’t touch
  10. Database Cache: Disk
  11. Object Cache: Don’t touch
  12. Browser Cache: Enable
  13. CDN: Choose Generic Mirror (Addition of cdn.exmaple.com in the forthcoming steps)
  14. Reverse Proxy: This should be enabled if you use Varnish. (Additionally, make sure to enter application path wordpress-xyz-abc.cloudwaysapps.com:8080 in case you are a Cloudways user. Your App path is mentioned at Applications > Domain management.)
  15. In the Miscellaneous tab, you need to uncheck Enable Google Page Speed dashboard widget.
  16. Save Settings and Purge Caches. At this step, the general Settings completes.
  17. Now open the Page Cache menu of the W3 Total Cache plugin.
  18. Check “Cache front page.”
  19. Check “Cache feeds: site, categories, tags, comments.”
  20. Check “Cache SSL (https) requests”
  21. Don’t change “Cache URIs with query string variables.”
  22. Don’t change “Cache 404 (not found) pages.”
  23. Check “Don’t cache pages for logged in users”
  24. Check “Don’t cache pages for following user roles.”
    Tip: You might choose user role – Administrator, Editor, and Author” for those you don’t wish to clutter with cache
  25. Aliases: Let it stay blank.
  26. Cache Preload: Keep it unchecked.
  27. Purge Policy: Should check Front Page, Post Page, Blog Feed
  28. Finally, save settings so that you never need to visit the Page Cache option of W3TC again.
  29. Please navigate to the Browser Cache menu and configure it correctly. (Typically, browser cache is regulated by an HTTP header names “cache-control” that guides the browser the proper way to manage e particular file. It decides whether to cache or not.)
  30. Firstly, you will notice the General Settings that specifies global browser cache policy. You might override depending on the file type. The same is the exceptional and flexible feature of this plugin. This feature is not found in any other well-known cache plugin.
  31. It is important to understand what these menus mean. First one is Last Modified, I advise enable it, assists Googlebot to do not forcefully crawl non-modified static resources.
  32. Set Expires header which is commonly utilized by proxy, to save file, web page in the cache memory for a specific time period. Make sure to keep it disable.
  33. Now you have to set the cache-control header which is utilized by browser. Now you have to keep it disable. Since keeping globally is not a decent idea.
  34. In this step, you have to set the entity tag (ETag) and keep that option enable. It assist browser to validate cached file either to be used or not.
  35. Now you need to set the W3 Total Cache header. In order to keep the thing white level you have to disable this feature. Either the header is disabled or enabled; it does not matter.
  36. Enable HTTP (gzip) compression: You may enable this feature.
  37. Avoid objects getting cached after settings change. Make sure not to enable it. Otherwise, it may add to your bandwidth consumption by avoiding appropriate browser cache. Particularly, this feature must be used only when you encounter some issue in which you are unable to override browser cache for the static files.
  38. Discard query strings from static resources: Please don’t enable this. When you enable this feature, it will just enhance grade by discarding query strings like ver=?2.3 outside the static files. Doing this will not enhance actual load time.
  39. Don’t set cookies for static files: Enable.
  40. Do not process 404 errors for static objects with WordPress: Famous feature from W3TC plugin that decreases server load for the 404. You may observe that how a single 404 error occasionally leads to a long time for loading. The particular option decrease the impact by serving simple 404 page instead of attractive for static files like jpg, txt, etc. It would be best if you did not worry as this is not for standard pages. It is recommended to enable this feature.
  41. The rewrite URL structure of objects: Let it stay uncheck.
  42. Apply HTTP Strict Transport Security policy: It is a great setting for caching “force HTTPS request”. If you are novice to WordPress, make sure not to enable this; it may lead to problems when you occasionally miss SSL. The browser will prevent the loading process in HTTPS or HTTP, except you keep valid certificate.
  43. Now, navigate down and find CSS & JS. The particular setting is applicable only for CSS and JS. Look at the screenshot below.
  44. For HTML, the Browser cache settings must have slight modification. It is clear that our HTML (a document in browser language) is basically a dynamic version of content. It is always better to not cache anything for HTML. Also, the same is not a recommended approach. In case you keep expire 3600seconds then it means that again W3TC will continue refreshing pages. It is better to prevent browser caching for HTML.
  45. For Media elements, the settings must be identical to JS and CSS. Go through the below screenshot.
  46. Now one important setting is CDN If you have enabled the “Generic Mirror” or CDN option in the most recent General Settings page in previous steps, you now have to configure it. (Warning: Please don’t alter any of these options otherwise you may face problem.)
  47. Navigate down a bit at the CDN page, and you will observe “General” settings. Go through the below screenshot.
  48. General: Don’t check Add canonical header: Google doesn’t support it.
  49. Configuration: Navigate down, and mention your CDN path
  50. Advanced: Navigate down and enable the Set cookie domain.
  51. Now CDN configuration is complete, so click on Save Settings and Purge Caches.
  52. Open the Extensions menu of W3TC. Make sure to disable everything apart from Yoast SEO. As a result, it will direct the correct CDN path for images within the Yoast XML Sitemap.

To Conclude:

All these steps included the needful tasks you need to follow.