Skip to content
BREW & BYTES
Website Development 4 min read Apr 13, 2025

How to Configure W3 Total Cache for Cloudways

Scott Hartley
With over 10 years of experience in digital marketing, Scott has helped hundreds of businesses achieve exponential growth through data-driven strategies and innovative solutions.

W3 Total Cache is a powerful and free caching plugin for WordPress that can drastically reduce the loading time of your website. However, when trying to utilize it on the Cloudways Hosting platform, you need to be aware of some common configuration issues due to server-side caching solutions. Varnish, Redis, and Memcached are all at your disposal, and below is our recommended configuration for them to achieve optimal results. This guide walks you through the proper setup to utilize these server-side caching solutions with W3 Total Cache on Cloudways to ensure maximum performance without conflicts.

  • Page Cache
  • Database cache
  • Object Cache
  • Reverse Proxy (Varnish)

Page Caching

W3 Total Cache Page Cache Settings

Why It Matters

Page caching will create a static HTML version of your WordPress page's and serve them from disk. Significantly reducing the load on your server and drastically improve the load times for your visitors.

Configuration Steps

  1. Navigate to Performance > General Settings and scroll down to > Page Cache in your W3 Total Cache settings
  2. Enable the Page Cache option
  3. Select "Disk: Enhanced" as your caching method
  4. This method uses rewrites to serve static HTML files directly, bypassing PHP processing
  5. Save your settings

Benefits

By using disk caching, a static copy of your website is saved on the server if Varnish has been purged, or if that specific page is not available, your server can serve this file. The Enhanced method delivers better performance than basic disk caching by directly serving an HTML file through your web server rather than routing back through PHP.

Database Caching

W3 Total Cache Database Cache Settings

Why It Matters

Database queries are often resource-intensive, particularly complex ones with solutions like WooCommerce. Caching these queries can improve server response times by storing them in memory while also reducing overall load.

Configuration Steps

  1. Go to Performance > Database Cache
  2. Enable the Database Cache option
  3. Select "Redis" as your Database Cache Method
  4. Enter the connection details (typically 127.0.0.1:6379)
  5. Set an appropriate cache lifetime (recommended: 3600 seconds)
  6. Save your settings

Important Note

You may receive a prompt about an object cache PHP drop-in needing to be removed. You should approve this removal since Cloudways includes Object Cache Pro by default. W3 Total Cache will handle the cache management without needing the default drop-in file.

Object Cache

W3 Total Cache Object Cache Settings

Why It Matters

Object caching stores the results of a lot of complex operations, storing them in memory will drastically reduce the load time, particularly while signed into the website, and reduce overall server load.

Configuration Steps

  1. Navigate to Performance > Object Cache
  2. Enable the Object Cache option
  3. Select "Redis" as your Object Cache Method (typically 127.0.0.1:6379)
  4. Configure the same connection settings used for Database Cache
  5. Save your settings

Warning

Never set Object Cache to use the disk as the storage method on Cloudways. This will cause significant issues with excessive inode generation and will decrease performance rather than improve it. Redis is the optimal solution for Cloudways environments.

Reverse Proxy

W3 Total Cache Reverse Proxy Caching

Why It Matters

Varnish is a powerful server-side cache that stores your pages in memory. Cloudways provides this caching method by default on all WordPress websites. Properly integrating W3 Total Cache with Varnish ensures cache purging works correctly when content is updated.

Configuration Steps

  1. Go to Performance > Reverse Proxy
  2. Enable the Reverse Proxy caching via Varnish option
  3. Enter 127.0.0.1:8080 in the Varnish servers field
  4. Save your settings

Verification

After configuring Varnish, test your site to ensure changes are being shown after clearing the cache. An easy way of doing this is to enable or disable a minify option in W3 Total Cache. If you clear all of the caches and it shows then you have it setup correctly!

To Summarize

Make sure that your Varnish Cache server is set to 127.0.0.1:8080 and that the server for Redis in your Object and Database caching is set to 127.0.0.1:6379.

Core Web VitalsWordPress

Share this article

Scott Hartley

With over 10 years of experience in digital marketing, Scott has helped hundreds of businesses achieve exponential growth through data-driven strategies and innovative solutions.

Leave a Comment

Your email address will not be published.

Related Articles

Cache Enabler Settings for WordPress
Website Development • 2 min read

How To Configure Cache Enabler for WordPress

Read Article

Stay Updated

Get the latest insights delivered straight to your inbox.

[newsletter_form]