The Ideal W3 Total Cache Settings For 2021 + Tips For CDNs, Fonts, Images, And Third Party Script Optimization

W3 Total Cache can be one of the most reliable plugins if you want to optimize your website with the free cache plugins. Undoubtedly, it is one of the best caching tools for a WordPress website. You can use this great plugin to make your site faster. That’s why W3 Total Cache Settings are so much important.

It’s a free cache plugin, but the options and settings can be overwhelming of this plugin. If you can use the right settings for the tool, it will be more than just a caching mechanism. Statistics showed that you could speed up your WordPress site five times better than usual by using W3 total cache.

You may need to spend about 5 minutes on applying the W3 Total Cache Settings. We will explain to you how you can speed up your WordPress website using W3 total cache plugin without wasting time. We will apply the settings basically in two sections.

At first, we will enable the general settings of W3 total cache, and then we will configure the advanced settings. A faster website makes your visitors happy as well as search engines will count your site as a special one. All in all, faster WP websites ultimately increase your site’s traffic.

First of all, let’s get some idea about this cache plugin that is called W3 Total Cache.

What Is W3 Total Cache Plugin?

W3 Total Cache plugin is a kind of framework which can optimize the overall performance of your WordPress site. This essential plugin helps to improve user experience and the page load speed.

Also, it helps to get the most out of caching storing data from the previous sessions that we can re-use for the following sessions. In this process, it reduces the server load time, which helps to load up the contents faster.

W3 Total Cache Settings and Configuration:

It’s not so easy to install and set up this WP cache plugin because there are tons of options to configure. But don’t worry, we are here to assist you. We will provide a step-by-step guide to make it as simple and understandable as possible. So you should conveniently follow the steps that we provide.

Step 1. Install

W3 Total Cache Plugin installW3 Total Cache is a free WP plugin that you can install. You will get it from the dashboard panel through Plugins. Then click on the Add New option and search for W3 Total Cache. After that, you should install it and also make sure you activate it. Now check out the Performance tab.

Step 2. Check the compatibility

Check the W3 Total Cache Plugin compatibilityYou can select the Dashboard, once you are on the Performance tab. You can operate a compatibility check and clear the caches here. In this step, you need to click on the Compatibility Check button to run a test on the server configuration that you are currently running.

You will know what options can be enabled based on these results. Additionally, you will get the knowledge of what kind of server you are now operating. You may not be able to fix all the problems if your site is running on the shared hosting.

Step 3. General settings

W3 Total Cache general settingsThe first job you need to do is to configure the General Settings option. It lets you approve the features what you will set later on. W3 Total Cache provides all of these features automatically. You have to turn off it as you do now need all of those.

If you want to test all the change before deploying you also can enable the Preview Mode. It could be a good idea, but you don’t need this feature if you follow our post word by word. We will recommend not to enable this feature because you will see all the options in the General Settings.

Step 4. Page cache

To transfer the files faster, Page Cache is very much significant. This feature produces a cache of your pages in the storage disk and moves them more quickly without using your hosting RAM power. You should enable this feature because this is the thing that you are here. You always need the Page Cache feature to achieve the better performance of your website.

You have to choose the Disk: Enhanced menu as the “Page Cache Method” after enabling the Page Cache feature. You don’t need to worry about it because it should be selected by default. You may notice that the plugin developer recommends the basic settings and we also recommend using “Compatibility mode” if you go to the Install tab.

General: – You should enable the items mentioned below in the general section.

W3 page Cache

  1. Cache front page.
  2. Cache feeds.
  3. Cache SSL (https) requests– Enable this only if you are using SSL.
  4. Cache URIs with query string variables.
  5. Cache 404 (not found) pages.
  6. Don’t cache pages for logged in users.

Aliases: – You can leave the “Aliases” settings disabled as it is already placed.

W3 Page Cache

Cache Preload: – This feature will automatically build a cache even before a user’s request. You can apply these following cache preload settings.

  1. Enable “Automatically prime the page cache” option.
  2. Update interval time 900 seconds.
  3. Pages per interval: Give it 10.
  4. Sitemap URL: Provide your sitemap URL.
  5. Enable the “Preload the post cache upon publishing events” option.

Cache Preload settings

Purge Policy: Page Cache: – This option configures which pages cache will be cleared whenever an old post is edited, or a post is published. You should select the pages that suit your need.

Purge Policy Page Cache settingsREST API: – Click on the “Don’t cache” option because you do not have to cache the Rest API for some apparent reasons. Apply this REST API setting and choose the “Save all settings” option.

REST API settingsAdvanced: – If you have the Memcached installed on your web server, then you can only enable the Memcached hostname and persistent connection settings. Otherwise, you should just leave it. All you need to be concerned in this feature is about the Compatibility mode, enable it, and leave other options as already they are.

REST API settings

Step 5. Minify

Minify settingsIf you use the Cloudflare, make sure that the Minify feature is turned off in the “General Settings” tab. The recommended settings by plugin developers for the minify, database cache, and object cache are preset.

Minification makes the WP website’s code smaller without any loss of functionality. Typically, it reduces the duplicate codes and spacing from your HTML, CSS, and Javascript files to decrease their size by up to 10%.

It will improve the load time of your website. For this reason, minification is so essential, even Google recommends it. So you should enable this Minify feature and apply these following settings for Minify.

  1. Enable minify.
  2. Leave the Minify mode to Auto.
  3. Select the Disk as the Minify Cache Method.
  4. Leave the HTML Minifier to default.
  5. Leave the JS Minifier to JSMin (default).
  6. Leave the CSS Minifier to default.

You may notice that all the options which are needed are already checked by default in the Minify setting. You may double check or move on to the other options under this setting.

General: – You should leave everything else as default rather than enabling the Minify error notification. Remember that the “Rewrite URL Structure” feature will only work when your web server is configured correctly with the W3 total cache plugin. Otherwise, it may break your WordPress CSS and JavaScript.

You can check your web server compatibility from the “Dashboard” of W3 total cache. You will need to integrate the Nginx web server with your W3 total cache if you use it. In this step of W3 Total Cache Settings, include your “nginx.conf” file to the Nginx Server settings, which is created by W3 total cache plugin on your public folder. Just untick the “Rewrite URL Structure” option if it is not working for you.


Minify error notification settingsHTML & XML: – To reduce the loading time of your site, you should enable the inline minification to line up all of your CSS and JS in your HTML file. Enable all the options without the “Don’t minify feeds” option.

HTML & XML settings

JS: – These settings should be enabled by default. By creating the non-blocking JS above the folder, these settings are responsible for improving the first visual impression of your WordPress site by using the “Defer” method. You should apply these following JavaScript Minification settings.

  1. Enable non-blocking by using “defer” before </head> and after <body>.
  2. Tick on the preserved comment removal and line break removal.
  3. Also, enable the HTTP/2 push.

JS settingsCSS: – This feature can help to combine all of your CSS files into one file to reduce the network lookup time. It makes your CSS file lighter by reducing its size. Check the following settings for CSS minification.

  1. At first, enable the CSS Minify option and make it combined only.
  2. Always enable HTTP/2 push.

CSS settingsAdvanced: – This feature is only applicable to those who have enabled the Memcached extension. Additionally, you should add all the external files like Google fonts and Analytic codes in your Minify settings. You also have the options here to change the garbage collection interval and update interval for external files etc.

CSS Advanced Settings

Step 6. Opcode Cache

Opcode Cache SettingsLet’s know some basic info about opcode. Typically, it is an enhancement extension of PHP. Opcode cache builds a cache of PHP code compilation into bytecode. All the time your web server will not compile PHP code. The web server will use the copy of opcode cache to minimize the parsing and compiling time of PHP files. You can enable the validate timestamp and select the Zend Opcache for opcode cache option.

Step 7. Database Cache

Database Cache settingsA database is a kind of place where everything on your website is stored. Your database may get crash when the user requests increase because all the information is pulled from your database once a user requests a post. So that you need a database cache.

It will save a cache of your database file on the disk to serve the information quickly without using the central Database. It ultimately depends on you of enabling or disabling the “Database Cache” option. It can optimize the database’s performance, which may improve the overall performance of your WP website.

It will be best to enable the option if you are on a dedicated server. On the other hand, allowing this option can hurt the performance of your site if your site is on shared hosting. It may overload the server’s CPU. You should leave the original settings as it is and no need to change anything.

Step 8. Object Cache

Object Cache settingsThis option entirely depends on what type of hosting you are using for your site. You should observe some performance issues if you are on shared hosting.

We recommend not to activate the object cache and leave it as it is because it can make your backend slow. But you can enable it or disable it later if you experience some problem. You have to choose “Disk” as the Object Cache Method if you want to allow it.

Advanced: – In the advanced option, you may leave everything as default. Insert the following setting as mentioned.

  1. In the field of “Default lifetime of cache objects” enter 180 seconds.
  2. In the field of “Garbage collection interval” enter 3600 seconds.

Advanced settingsStep 9. Browser Cache

Browser Cache settingsThis feature helps to speed up the website by storing resources in the browsers. In this method, the visitors or users don’t have to reload the site consistently. So you should enable the “Browser Cache” feature.

Because your browser always saves the temporary files from a site just like HTML, CSS, JS, images, and other multimedia files. You can enable HTTP compression and add headers in the browser cache feature to reduce the server load and decrease file load time.

General: – Under the “General” options, simply enable or tick the following settings. Also, leave the other options as default.

  1. Enable the “Set Last-Modified header.”
  2. Tick on the “Set expires header.”
  3. Click the “Set cache control header.”
  4. Allow the “Set entity tag (ETag).”
  5. Enable the “Set W3 total cache header.”
  6. Tick on the “Enable HTTP (gzip) connection.”
  7. Click the “Prevent caching of an object after settings change.”
  8. Allow the “Remove query string.”
  9. Select the “Don’t set cookies for static files.”

In the end, press the “Save settings” and “Purge Cache” button to save these options.

Step 10. CDN

CDN (Content Delivery Network) permitted you to serve the static content from many servers. It can reduce the load time and speed up your website. So you should enable this and leave the other options as default.

CDN settingsCDN providers like MaxCDN, StackPath reduces the geographical distance between your server and visitor. You have only one origin server without a CDN that can be very far away for many people. If you can use both Cloudflare and StackPath, you may get better results. Each of these CDN providers has their own data centers, and more data centers mean faster delivery of content.

StackPath CDN is especially suitable for improving items like use a content delivery network, reduce DNS lookups, reduce HTTP requests, cookie-free domains, and reduce cookie size. You also may use Cloudflare to host the cache of your WordPress web pages from different locations. It can improve the latency time for your users and visitors. You can easily setup Cloudflare and StackPath with W3 Total Cache plugin.

Step 11. Fragment Cache

Fragment Cache can make your website better and faster. If you want to use this feature, you may have to upgrade on W3 Total Cache Pro version. We will recommend to don’t use it because you should have some coding experience before using this feature.

Step 12. Reverse Proxy

You should leave the “Reverse Proxy” disabled because it requires private hosting.

Step 13. Monitoring

No need to configure it and you may ignore this option.

Step 14. Debug

Debug settingsWe will not suggest it for the beginners. But if you are a developer, then you may need this feature. So select all the options in “Debug mode” if you want to use them.

Step 15. Extensions

Extensions settingsAt first, activate the “CloudFlare” feature and then go to the below steps. You may click the “upgrade” button in W3 Total Cache to get W3 Total Cache Pro version if you use the Genesis Framework in your WP site. This extension can improve site speed and allow additional speed features. You should activate the “Yoast SEO” feature if you like to use WordPress SEO by Yoast.

Step 16. Problems and Solutions

You may inspect some issues when configuring the W3 Total Cache plugin. We will support you to solve these issues. If you found that your website breaks and the formatting gets wacky, immediately disable the “Minify” option from the General Settings tab.

Disable the “object cache” option for slow WordPress dashboard. Always try to avoid slow loading plugins that are consuming high CPU. If your website gets crashed, then you have to open wp-config and delete these lines:

/** Enable W3 Total Cache */

define(‘WP_CACHE’, true); // Added by W3 Total Cache

Also, open .htaccess and delete all the codings between these two lines:



After that, you need to delete:

  1. advanced-cache.php
  2. objectcache.php
  3. db.php from wp-content
  4. w3-total-cache folder in wp-content/plugins.


You are now ready to go, and all the things are set for improved performance of a lifetime. Hopefully, our W3 Total Cache Settings guide will help you to enhance your user experience, though these steps can be a bit technical. We would appreciate your suggestions and proposals if you have some.


Leave a Comment

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

Scroll to Top