W3 Total Cache Settings For Beginners (Cloudflare + BunnyCDN)

W3 Total Cache is a complete solution for those who are looking to enhance their site speed. Even its free version is enough to make your site load faster.

However, I don’t really recommend W3 Total Cache because it might break your site. Also, some features (like database cleanup, heartbeat control, and optimizing Google Fonts) are not supportable.

In this post, we will look at the ideal settings for W3 Total Cache. Follow these instructions given below carefully to optimize your site speed.

Installation Process

To install W3 Total Cache, simply visit the plugin section of WordPress, and type “W3 Total Cache” in the search box.

Install and Activate the plugin

Once the plugin is activated, Click On Settings

Accept Data Collection (allowing W3 Total Cache to collect data will help to improve the plugin performance in the future)

Here is the W3 total cache menu.

The plugin tour has been completed now let’s go through the settings one by one to set up W3 Total Cache perfectly.

(1) General Settings


  • Preview Mode

This feature lets you test the settings first. Once you’re happy with all the changes, you can deploy them. I recommend keeping it disabled.

Page Cache

  • Page Cache

Page cache helps your site load faster for returning visitors. Enable it to improve server response time.

  • Page Cache Method

W3 Total Cache will automatically select it for you. In case it doesn’t, select Disk Enhanced if you’re using shared hosting and Memcached for cloud hosting.


Minify is an awesome feature that helps to reduce the size of and the number of CSS and JS files. Which significantly improves the loading time.

  • Minify

Enable minify. W3 Total Cache will show you pop with a warning, just click on I Understand The Risk.

  • Minify Mode

Select Auto and let W3 Total Cache minify CSS and Java files.

  • Minify Cache Method

Select Disk if you’re using shared hosting. Memcached for cloud servers. (W3 total cache will automatically select it for you)

  • HTML Minifier

Leave it us Minify (Default)

  • JS Minifier

Select JSMin Default.

  • CSS Minifier

Let it Minify (default)

OpCode Cache

  • Opcode Cache

For some users, it might not be available. If it is available, then select Opcode: Zen Opcache.

  • Validate Timestamps

Don’t enable it.

Database Cache

  • Database cache

Enable it for faster server response time. Enabling it makes your site faster for your site’s users and makes the admin panel faster, which helps you get a speedier experience overall.

  • Database cache Method

Choose Disk if your site is on shared servers. For cloud users, choose Memcached.

database cache settings for w3 total cache

Object Cache

Do not enable it.

It has been noticed that it slows down the site both extremely and internally. However, you can test it yourself to see the effect, if it helps, keep it enabled. If it doesn’t simply disable it. I don’t recommend enabling it.

Browser Cache

  • Browser cache

Enable it. Browser cache remembers parts of pages, like images, to help them open faster during your next visit.


  • CDN

Enable if you’ll use BunnyCDN (In this tutorial, I’ll show you how to connect BunnyCDN with W3 Total cache). Keep it disabled, if you’re using Cloudflare or if you’re about to use Cloudflare.

Click On Save All Settings

Make sure to save everything you’ve changed, so that you don’t have to repeat it.


FSD CDN is a CDN partner of W3 Total Cache that guarantees better load time. However, this feature is only for premium users, so, ignore it if you’re not ready to buy their premium plan yet.

Reverse Proxy

Reverse Proxy helps to enhance the performance, security, and reliability of the webserver. A reverse proxy sits in front of a web server and takes all the requests before they reach the origin server.

But in order to use Varnish, the Varnish package must first be installed by your host. It could be a little complicated for non-experts, so I recommend keeping it disabled, however, if you just need some help on how to set it up. Read this tutorial by Tutsplus.com

User Experience

One of the most important settings. User Experience is the key to success. You need to make sure the users are getting what they expect from your site. Just because of slow speed, some sites provide a poor experience to the users even after having tons of great quality posts.

Plugins like W3 Total Cache can definitely improve the user experience. Follow the settings below to enhance it now.

  • Lazy Load Images

Enable it. Almost every version of WordPress supports lazy loading, however, plugins like these can take it to another level.

Some people can’t compromise with their image quality, and I’m one of those. That’s why it becomes crucial to have a plugin like this that can help us decrease the page loading time by lazy loading images.

  • Emoji

Depends On You. Emojis take a lot of time to load, but they also look great and engage the audience more. So, it totally depends on you whether you want to enable it or keep it disabled. Btw, I’ve enabled it for my site.

  • Wp-Embed Scripts

Disable It. Internal linking is good but embedding your own post can increase loading time and it doesn’t look good as well. So, it’s my recommendation to keep it disabled, however, this also depends on you.

  • Disable JQuery Migrate on the front end

Disable It. Most websites that use up-to-date themes and plugins don’t require jQuery Migrate on the frontend, and it can slow down a site so, keep it disabled.


It’s a premium feature that’ll show you cache usage statistics. It could be helpful to detect a few things, but it isn’t necessary.

now Save All The Settings

Fragment Cache

Fragment Caching is very similar to Object Caching, it helps to improve performance by decreasing the total number of database queries required to generate pages for many users.

This works by saving up MySQL server resources taken by serving repeated queries returning the same data each time so that it has more power to handle real dynamic data.

  • Fragment Cache Method

Select Disk if you’re using shared hosting and Memecahced for cloud hosting.


You can enter the key that you’ve received after purchasing their premium plan, and verify to upgrade to premium.


Some extra settings that are useful.

  • Enable Google Page Speed Dashboard Widget

Enable it. By enabling it, you’ll get to see daily reports about your site’s speed which could be beneficial in improving the site’s performance.

Page Speed API Key: Leave it empty

Key Restriction (Referrer): Leave it empty

  • Show Page Rating Admin Bar

Keep It Unchecked

  • Verify Rewrite Rules

Enable It.

  • Enable File Locking

Let it be disabled.

  • Optimize disk enhanced page and minify disk caching for NFS

Enable It.

  • Fix Document Root Path

Keep It Disabled.

  • Anonymously track usage to improve product quality

It depends on you whether you want to enable it or not. If you enable it, it may help W3 total cache team to improve their quality.


Leave everything unchecked.

Purge Logs

Another premium feature provides information on when your cache has been purged and what triggered it.

Import/Export Settings

As the name suggests, this option can let you import or export settings. If your friend has already set up it perfectly, ask him to provide you the configuration file. It is easily uploadable and downloadable.

Also, if you’ve messed up with the settings then you can always reset to the default settings.

So all the settings for general Settings have been completed, now let’s move on to another section which is Page Cache. But, before you move, make sure to save all the settings.

(2) Page Cache

This is the most important part or setting to speed up your site. Make sure to follow everything shared below correctly.


  • Cache Front Page: Enable

Frontpage is the most important page for any website. It is recommended to enable caching for the front page.

  • Cache feeds: site, categories, tags, comments: Enable

Important to enable. It saves your server from unnecessary pressure.

  •  Cache SSL (HTTPS) requests: Enable

  • Cache URIs with query string variables: Disable

  • Cache 404 (not found) pages: Enable

Reduces server response time and improves overall performance.

  • Don’t cache pages for logged in users: Enable

Do not disable it because it might cause trouble.

  • Don’t cache pages for the following user roles: Enable

Select everything (Administrator, editor, author, contribute, Subscriber)

Now, click on Save All Settings.


Do not touch it. Leave it like that and move on to the next step.

Cache Preload

This is an awesome feature that creates cache pages after a specific time.

  • Automatically prime the page cache

Enable it.

Update interval: 900 Seconds

Pages per interval: 10

Sitemap URL: Enter your sitemap URL, Example.com/sitemap_index.xml

  • Preload the post cache upon publish events

Enable it

Purge Policy

You don’t need to change anything here. W3 Total Cache has already been set up for us. Leave it as default and continue to the next setting

Rest API

Select Don’t Cache.

Advance Setting

Only Enable Compatibility mode. Don’t touch anything else unless you know what you’re doing.

Hit the Save All Settings Option to save everything you’ve done.

(3) Minify

According to imperva.com, Minification dramatically improves site speed and accessibility means a better user experience. It’s also beneficial to users reaching your website through a limited data plan and who would prefer to save on their bandwidth usage while surfing the web.


Only enable Rewrite URL structure, leave else disable.


Could be beneficial in decreasing loading time. Enable it, however, keep everything else disabled.

JS Configuration

Javascript minification is crucial and very effective in boosting site speed. W3 total cache knowns that and they have configured it well. You don’t need to change anything here.

CS Configuration

Like JS minification, CS minification is also incredibly valuable in keeping your site lightweight. And, W3 total cache default settings are perfect. Continue to the next step because there is nothing to change.

Advance Settings

Leave as it is. Or, only do the changes if you’re an expert. Playing with this section could break your site or stop the plugin to work properly.

Click On Save Settings

(4) Database Cache

All the settings for the database cache are pre-configured. Don’t change anything and continue to the next one.

(5) Object Cache

According to Wp Astra,

Object caching involves storing database queries and, when permitted on your WordPress site, it can assist in speeding up PHP execution times, lessen the load on your database, and deliver content to your visitors quicker. 

Rather than loading up every part of a website every time a user accesses it, object caching stores database queries that can retrieve content more immediately when it is needed. There are a lot of different types of object caching, such as browser, mobile, and user caching.

Object Caching should be on point if you want a super-fast website and better user experience. Thankfully, W3 Total Cache already set up everything under Object Cache for us. Everything is perfect so, continue to the next section without changing anything here.

Read More:

How To Update PHP Versions In WordPress (PHP 8.0 & 7.4) Every Host Covered

List Of Fastest WordPress Hosts In 2021: 8 Hosts Compared

(6) Browser Cache

Even google knows the importance of browsers cache. Google says They make the online experience easier by saving browsing data. The cache remembers parts of pages, like images, to help them open faster during your next visit.


Set Last-Modified header: Enable

Set expires header: Enable

Set cache-control header: Enable

Set entity tag (ETag): Enable

Set W3 Total Cache header: Enable

Enable HTTP (gzip) compression: Enable

Enable HTTP (brotli) compression: Disable

Prevent caching of objects after settings change: Disable

Remove query strings from static resources: Enable

Don’t set cookies for static files: Enable

Do not process 404 errors for static objects with WordPress: Disable

404 error exception list: Don’t Change Anything

Rewrite URL structure of objects: Disable


Note: Brotli Compression option is available in the Cloudflare dashboard. Enable Brotli compression from there if you’re using Cloudflare, if not, then turn it on.

Set Last-Modified header: Enable

Set expires header: Enable

Expires header lifetime: Don’t Change Anything Here

Set cache-control header: Enable

Cache-Control policy: Don’t Change Anything Here

Set entity tag (eTag): Enable

Set W3 Total Cache header: Enable

Enable HTTP (gzip) compression: Enable

Enable HTTP (brotli) compression: Disable

Prevent caching of objects after settings change: Disable

Remove query strings from static resources: Enable

Disable cookies for static files: Enable


Set Last-Modified header: Enable

Set expires header: Enable

Expires header lifetime: Don’t change anything here

Set cache-control header: Enable

Cache-Control policy: Ignore it

Set entity tag (ETag): Enable

Set W3 Total Cache header: Enable

Enable HTTP (gzip) compression: Enable

Enable HTTP (brotli) compression: Disable (If you’re using Cloudflare then turn this function on from Cloudflare’s menu/dashboard.)

Media & Other Files

Set Last-Modified header: Enable

Set expires header: Enable

Expires header lifetime: Don’t need to change anything.

Set cache-control header: Enable

Cache-Control policy: Ignore it

Set entity tag (ETag): Enable

Set W3 Total Cache header: Enable

Enable HTTP (gzip) compression: Enable

Enable HTTP (brotli) compression: Disable

Prevent caching of objects after settings change: Disable

Remove query strings from static resources: Enable

Disable cookies for static files: Enable

Security Headers

It is a feature that promises to improve the security of the website. However, you don’t really need to do anything here. Ignore it and move on to the next step. Also, it is a little complicated to set up so save your time. I recommend updating plugins and themes on time and setting up a really strong password so that no one can hack your site.

(7) Cache Groups

Manage User Agent Groups

If you’re using a mobile responsive theme, then you don’t really need to change anything here. It’s fine!

Manage Referrer Groups

By setting up manage referrer groups, you can serve a unique cached version for users who come to your site through specific traffic sources (eg. Google, Duckduckgo, or Bing). Most websites leave it disabled, and you should also do that.

Manage Cookies Groups

This setting will do the same work as Referrer groups, and I recommend it keeping disabled.

All done, now let’s move on to the most complicated and exciting part, CDN!

Read More:

How To Fix Slow WordPress Admin Panel (Dashboard) With These 17 Tweaks

How To Exclude Your IP Address From Google Analytics & Google Analytics 4: Step By Step

(8) CDN

First, we gonna look at how we can connect BunnyCDN. I recommend using BunnyCDN because it has been noticed that it reduces server response time quite well. While Cloudflare struggles in that area even after having more than 190 servers all across the world.

Note: You can’t use two CDN’s. Either use BunnyCDN or Cloudflare, but don’t set up both because it may cause some issues.

How To Connect Bunny CDN With W3 Total Cache

Step 1: Go Back To General Settings And Enable CDN

As I said earlier, to use BunnyCDN you have to enable CDN from general settings. Also, select Generic Mirror from the dropdown menu.

Step 2: Create BunnyCDN Account

I’m not an affiliate of BunnyCDN. I am promoting BunnyCDN because they are actually good, and they also offer 14 days free trial. Also, they charge according to the usage.

Click on “Try FREE For 14 Days to go to the signup page.

Bunny CDN Setup

Step 2: Fill Up Login Info

Fill your email and set up a strong password. Also, check T&C.

Bunny CDN Setup 2

Step 3: Check Your Email

Bunny CDN will send you a mail to confirm your account. Click on “Confirm Account”

Confirm your bunny.net account

Step 4: Add Pull Zone Set Up

Create a Pull Zone.

  • Fill in your site’s name (Just name, no extensions like .com or .net)
  • Enter your original URL (example, hostinggrow.com)
Add Pull Zone bunny.net

Step 5: Copy Your Bunny CDN URL

A new page will open where your Bunny CDN URL will be visible. (Scroll down) Copy it.

Pull Zone Installation Instructions bunny.net

Step 6: Paste The Copied URL

Now, go back to the CDN section of W3 Total Cache, and paste it and click Add CNAME

Step 7: In BunnyCDN, Click on purge pull zone

Go to BunnyCDN and click on Purge Pull Zone.

Step 8: Check CDN Score In GTmatrix

Go to Gtmatrix.com and check your website’s overall speed performance. Scroll down and check the CDN color signal, it should be green.


Advanced settings for CDN.

How To Connect Cloudflare With W3 Total Cache

Note: You can’t use two CDN’s. If you have already set up BunnyCDN then do not connect Cloudflare! Also, make sure the CDN option in the general settings is off/disabled.

Step 1: Click On Extension And Activate Cloudflare

Activate Cloudflare from the extension section and then click on settings.

Step 2: Create A Cloudflare Account

Go to Cloudflare.com and create a free account. Enter your email and set up a strong password.

Step 2: Select Cloudflare For Infrastructure Program

Account Cloudflare Web Performance Security

Step 3: Add Your Website (Enter Your website Name)

Account Cloudflare Web Performance Security 1

Step 4: Choose The Plan

Cloudflare allows 4 types of plans, 3 paid and one free. For this tutorial, I am choosing a free one.

guidemewp.com Account Cloudflare Web Performance Security

Click on continue after picking the plan.

Step 5: Cloudflare Will Check Your Site’s DNS

Cloudflare will show you the records. It might confuse you if you are a beginner. Just snap on the continue button once everything loads.

guidemewp.com Account Cloudflare Web Performance Security 1

Step 6: Change NameServers

This is the most crucial step to connect Cloudflare. You have to change your site’s current name servers with Cloudflare’s nameservers.

Copy Cloudflare’s both the nameservers and paste them in sticky notes.

guidemewp.com Account Cloudflare Web Performance Security 2

Step 7: Log Into Your Domain Registrar Account

  • Sign Into Your Godaddy Account
  • Click On DNS

For this tutorial, I am using the GoDaddy domain.

Once you are logged in, scroll down and you’ll “DNS” option, click on it.

Godaddy Setting DNS
  • Click On Change (Change Nameservers)

Your current nameservers will be noticeable under Nameservers, click on “Change” to replace them with Cloudflare’s nameservers.

Godaddy nameservers change 2

Step 8: Paste Cloudflare’s Nameservers

Paste the nameservers you have copied.

Cloudflare nameservers

Click on Save to keep the changes.

Step 9: Click On Confirm Nameservers

Go back to Cloudflare and “click on Confirm Nameservers”. It may take up to 24hrs to propagate, but usually, it propagates within an hour.

Step 10: Review Cloudflare’s Success Message

guidemewp.com Account Cloudflare Web Performance Security 3

Step 11: Go Back To W3 Total Cache CDN Settings And Click On Open Configuration

Step 12: Click On Authorize Under Credentials

Now, the W3 Toal cache will ask you to enter your Cloudflare email and API key. To find the API key, you need to visit the Cloudflare Dashboard.

Step 12: Find The API Key And Copy It

Once you enter your Cloudflare dashboard, scroll down a bit and you’ll see the API section, under it, the API Token option will be available.

Click on “Get Your API Token”

Click on View Global API Key.

Now, Cloudflare will ask you to enter the password, and also show you a captcha to ensure you’re not a robot.

Copy Your API Key

Step 13: Paste The API Key And Enter Your Email

We’re almost done. Paste the copied API key and enter the email, then click on next.

Select your website if you’ve multiple sites connected to Cloudflare.

Step 14: Check

Check for the success message. If you’ve not got the message then try to repeat the steps or comment below, I’ll try my best to resolve it.

Run A Gtmtrix Test To Check Whether The CDN Is Working Or Not.

To test CDN, you need to visit GTmatrix.com and enter your site name. GTmatrix will show you complete info on your site loading speed. Great tool for bloggers!

Now, let’s finish it by setting up some other sections of the W3 total cache.

(9) Fragment Cache

Fragment Cache is a great tool that changes heavy parts of a website, however, this feature is locked and unavailable for free users. Also, you may need some coding experience to set up Fragment cache perfectly. Currently, I’m using a free version of the W3 total cache so I don’t really need to change anything here.

(10) User Experience

W3 Total Cache free version can help you with the basic level of lazy loading however, It can’t lazy load embed videos and other embed items such as graphs and forms.

There are some plugins available that can do better lazy loading for free even with their free version. If you want W3 Total Cache to lazy load better, you can always purchase their premium version.

(11) Extensions

These extensions can make W3 Total Cache work even better. However, I’m not a huge fan of AMP. I know it increases speed drastically, however, it fails to deliver the best version of our site to the users. It sacrifices a lot of great features, also, it could decrease the ad revenue especially if you’re using Ezoic, Mediavine or Adthrive (I’ve noticed it)

Everything is done, now go to GTmatrix or Google Pagespeed insight to check the improvement.

Read Similar Posts:

Wp Fastest Cache Settings: Complete Settings With Screenshots

How To Create A Bluehost Staging Site: Ridiculously Easy

What To Do If Your Site Is Still Slow?

No need to worry!

The main reason could be your host. If you’re a bad host like Hostgator, Bluehost, DreamHost, or Godaddy hosting, then it is time to change it. These hosts are very slow, I recommend A2Hosting for beginners, and Cloudways for pros.

Cloudways is the fastest host, but hard to use while A2Hosting is easy to use and super fast as well. Also, you can do these things listed below to increase the speed of your site without changing your host.

  • Don’t use too many plugins (should be less than 20)
  • Update plugins and themes
  • Use Lazy lding
  • Use basic theme
  • Don’t use GIFs if it’s not important.
  • Use image compressor
  • Use AMP if your niche belongs to news or foods.

I Hope This Post Was Helpful!

Thanks For Reading!


Sumit is a regular contributor to Hostinggrow.com. He has 6 years of experience in blogging, and he loves football, his favorite player is - Lionel Messi (GOAT), but he has no hate for Ronaldo.

Articles: 61

Leave a Reply

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