W3 Total Cache Settings for Nginx (2026): Tested Setup + Is It Still Worth Using?

W3 Total Cache settings: Setup Guide page cache test, Disk: Enhanced 288 ms vs 522 ms with no cache (−45%)

These are the W3 Total Cache settings I used on an Nginx server, tested one step at a time on a real WordPress site: Page Cache on Disk: Enhanced (with W3TC’s nginx.conf included in the server block), Minify on Auto, Redis for object cache, Database Cache off, Browser Cache on, and Lazy Load on. That took server response from 0.76 s to 0.230 s and PageSpeed mobile to 98 with LCP 1.7 s. Below is every setting, why, and the two Nginx steps most W3 Total Cache settings guides skip. If you’re still choosing a plugin, here is my tested pick for the best WordPress cache plugin on Nginx.

My W3 Total Cache settings at a glance

SettingValueWhy
Page CacheOn, Disk: EnhancedFastest in W3TC’s own test (288 ms vs 522 ms with no cache); Nginx serves pages without PHP once you include the rules
MinifyOn, AutoFree CSS/JS/HTML minify; switch to Manual only if something breaks
Opcode CacheZend OPcache (detected)Already on in PHP; nothing to do
Database CacheOffW3TC’s own wizard says leave it off unless you use Redis/Memcached for it
Object CacheOn, Redis (own database number)Test passed on my VPS; skip on shared hosting
Browser CacheOnCache-Control, ETag, Last-Modified, gzip
Lazy LoadOnFree in User Experience; part of the full setup that took LCP from 2.5 s to 1.7 s
CDN / Cloudflare extensionOffOnly if you use a CDN for static files

Tested: W3 Total Cache 2.11.0 (free), WordPress 7.1.4, PHP 8.5, Nginx on an aaPanel VPS in Hong Kong (YottaSrc), Redis on the same server, Cloudflare proxied without HTML caching. Measured from Dhaka, 8–9 November 2026, on fashionlookbd.shop (noindex test site). Curl TTFB = median of 4 runs; PageSpeed = middle of 3 mobile runs. Differences under ±0.05 s TTFB or ±3 PageSpeed points count as a tie.

Before you start

  • Remove any other cache plugin completely, including its advanced-cache.php and any WP_CACHE line it left. Two page caches don’t mix. My advanced-cache.php guide has the checklist.
  • Take a backup and know how to edit your Nginx site config (aaPanel: Website → your site → Config file). One of the steps below adds a line there.
  • Shared hosting? You can’t edit Nginx config and may not have Redis. Use Disk: Basic and skip Object Cache; the rest still applies.

Step 1: Install and run the Setup Guide

Plugins → Add New → “W3 Total Cache” → Install → Activate. W3TC opens its Setup Guide: Welcome, Page Cache, Database Cache, Object Cache, Image Converter, Lazy Load, then More Caching Options. On the Page Cache step, click Test Page Cache. It times your homepage with no cache and with each engine your server supports, and tells you to choose from the Average column. My results:

W3 Total Cache settings Setup Guide page cache test on Nginx: None 522.6 ms, Disk Basic 381.5 ms, Disk Enhanced 288.4 ms, Redis 376.8 ms
W3TC’s Page Cache test on my server. Memcached, APC and the rest were unavailable.
Storage engineAverage (ms)vs no cache
None522.60–
Disk: Basic381.52−27%
Disk: Enhanced (Recommended)288.44−45%
Redis376.76−28%

Redis is a great object cache, but as a page cache it lost to plain files here. Disk: Enhanced won, so that’s what I used. I picked Disk: Basic in the wizard first, only to show the difference the Nginx rules make (next steps), then moved to Enhanced. In the Database Cache and Object Cache steps I chose None and didn’t run the tests; I set object cache up properly later. I enabled Lazy Load in the wizard and skipped the Image Converter.

Step 2: General Settings

Performance → General Settings is the main page. Each feature has an Enable box and a method. Here’s what I set, box by box.

W3 Total Cache General Settings with Page Cache enabled and Minify options
General Settings on my first pass (Disk: Basic, Minify off).

Page Cache: Disk: Basic vs Disk: Enhanced

Disk: Basic saves pages as files but still starts PHP to send them. Disk: Enhanced writes rules that let the web server send the cached HTML file directly. On Apache those rules go into .htaccess automatically. On Nginx they don’t do anything until you include them, which is Step 3.

I measured both on the same page. Disk: Basic: 0.246 s TTFB, and the response headers still had WordPress’s x-pingback and link headers, meaning PHP built it. Disk: Enhanced with the include: 0.233 s, and those headers were gone. From Dhaka the 13 ms gap is small; the real win is that cached pages no longer use a PHP worker, which matters when traffic spikes.

Response headers with W3 Total Cache Disk Basic still showing x-pingback and link headers from PHP
Disk: Basic: x-pingback and link headers mean PHP served the page.
Response headers with W3 Total Cache Disk Enhanced and no PHP headers, served by Nginx
Disk: Enhanced + include: those headers are gone, Nginx served the file.

Minify: Auto

Turn on Minify and leave the mode on Auto. W3TC’s own readme on WordPress.org says to switch to Manual only if Auto breaks your layout. On Nginx, turn Minify on only after you’ve done Step 3, because minified files are served by rules in the same nginx.conf. Reload Nginx after enabling it.

Opcode Cache

This box just shows what PHP already has. Mine said “Opcode: Zend Opcache” with Validate timestamps ticked. Leave it.

Database Cache: off

Leave it off. W3TC’s own Setup Guide says the feature is disabled by default and recommends Redis or Memcached for it, “otherwise leave this feature disabled as the server database engine may be faster than using disk caching.” The settings page agrees: best used if object caching isn’t possible. I used object cache instead.

W3 Total Cache Opcode Cache with Zend OPcache and Database Cache left disabled
Opcode Cache detected; Database Cache left off.

Object Cache: Redis, with its own database number

If your server runs Redis (aaPanel can install it from the App Store, see my aaPanel Redis guide), use it here. My Redis is shared by several sites, so W3TC needed a database number nobody else uses. I checked with redis-cli -n 9 dbsize (it only counts keys in database 9 and changes nothing), got 0, and used 9.

Order matters. Set the method to Redis without ticking Enable, save, then go to Performance → Object Cache, enter 127.0.0.1:6379, the database ID and password, save and click Test. Only then tick Enable in General Settings. If you enable first, W3TC starts writing to database 0, which may belong to another site.

W3 Total Cache Object Cache page with Redis server, database 9 and test passed
Object Cache: Redis on 127.0.0.1:6379, database 9, test passed.

It worked: the page source footprint later showed “Object Caching 19/72 objects using Redis”. On shared hosting without Redis, skip Object Cache; W3TC’s own readme warns about disk-based object and database caching there.

Browser Cache: on

Turn it on. On the Browser Cache page my defaults were Last-Modified, Cache-Control and ETag headers on, Expires header off, and HTTP (gzip) compression on. Brotli was greyed out (it needs a Brotli extension on the server). That’s fine as it is.

W3 Total Cache Browser Cache settings with cache control, ETag and gzip enabled
Browser Cache defaults I kept.

Preview mode, Image Converter, Import/Export

Preview mode (top of General Settings) lets you try settings as an admin before visitors get them; useful on a busy site. Image Converter makes WebP copies through BoldGrid’s servers; the free limit is 10 images an hour and 100 a month (AVIF is Pro). I skipped it because my images are already WebP. At the bottom, Import / Export Settings downloads your configuration; do that once you’re happy, so you can restore it later.

CDN, Reverse Proxy, Debug

Leave CDN off unless you serve static files from one. Reverse Proxy is for Varnish setups. Debug stays off on a live site: it adds comments and slows things down.

Step 3: Include the W3 Total Cache nginx.conf in your server block

This is the step nearly every W3 Total Cache settings guide leaves out, because most were written for Apache. When you pick Disk: Enhanced, enable Minify or Browser Cache, W3TC writes its rules to a file called nginx.conf in your WordPress root and shows this notice:

W3 Total Cache notice that nginx.conf rules have been updated and Nginx should be restarted
The notice that tells you rules changed. Nginx won’t read them on its own.

Nginx never reads files in your site folder unless the server config tells it to. So you add one line. Performance → Install shows the rules and the file path:

W3 Total Cache Install tab showing generated Nginx rules for page cache and minify
Performance → Install: the rules W3TC generated, and where it saved them.

In aaPanel: Website → your site → Config file. Inside the server { block, right after the root line, add:

include /www/wwwroot/yourdomain.com/nginx.conf;

Use the exact path from W3TC’s notice. Save. aaPanel tests the config before saving, so a typo can’t take Nginx down; if it refuses to save, check the path.

aaPanel Nginx site config file before adding the W3 Total Cache include line
Before: the site’s server block in aaPanel.
aaPanel Nginx config with include line for W3 Total Cache nginx.conf after root
After: line 11 includes W3TC’s nginx.conf.

What this changes: only this site’s server block. Undo it by deleting the line and saving.

Reload Nginx whenever W3TC updates the rules. W3TC rewrites nginx.conf when you enable Minify too, so reload after that change as well. In aaPanel: App Store → Nginx → Settings → Reload (or save the site config again). A reload keeps serving visitors and falls back to the old config if the new one has an error. Without it, Nginx keeps using the old rules.

Not on aaPanel? The same line goes in your site’s server block (often in /etc/nginx/sites-available/), then sudo nginx -t (tests the config, changes nothing) and sudo systemctl reload nginx. You can also tell W3TC to write the file elsewhere with the “Nginx server configuration file path” option in General Settings; since 2.10 it must end in .conf.

Step 4: Page Cache page (preload)

Performance → Page Cache. Under Cache Preload I ticked Automatically prime the page cache, kept the update interval at 900 seconds and 10 pages per interval, and entered my sitemap URL (/sitemap_index.xml from Rank Math). Low-powered server? Lower the pages per interval. Since 2.10.7 there’s also “Preload the sitemap once”, which stops after one pass; I left it off so new posts keep getting primed. Then Empty All Caches from the admin bar so preloading starts clean.

W3 Total Cache Page Cache preload settings with sitemap URL, 900 second interval and 10 pages
Cache Preload: sitemap-based, 10 pages every 900 seconds.

Step 5: Minify page

With Auto mode you don’t have to list files. I left Rewrite URL structure on and HTML minify off (the default) and changed nothing else. If something looks broken after minify, check it logged out in a private window, add the file to Minify’s never-minify list, or switch to Manual mode.

W3 Total Cache Minify settings with Rewrite URL structure enabled
Minify page: defaults kept with Auto mode.

Step 6: User Experience (lazy load)

Performance → User Experience. Lazy Load Images is free; I turned it on. Disable Emoji, wp-embed and jquery-migrate are free too; I didn’t change them. Delay Scripts, Remove Unused CSS/JS, Lazy Load Google Maps and Preload Requests are Pro.

W3 Total Cache User Experience page with Lazy Load images enabled
Lazy Load is free in W3TC; delay scripts and unused CSS removal are Pro.

I didn’t test lazy load and minify separately, but together they are the main difference from the two plugins below. Pages cached by WP Super Cache and WP Fastest Cache (free) were just as quick to arrive but kept LCP at 2.7–2.8 s; W3TC’s full setup got 1.7 s.

Extensions: Cloudflare and the rest

Performance → Extensions lists 11. All were off on a fresh install. The Cloudflare extension (free) connects with an API token and lets W3TC purge Cloudflare when it purges its own cache. I didn’t enable it: my Cloudflare doesn’t cache HTML, so there was nothing to purge. Always Cached, Fragment Cache and Genesis are Pro.

W3 Total Cache Extensions page with Cloudflare, AMP and Pro extensions
Extensions: Cloudflare is free; several others need Pro.

Results with these W3 Total Cache settings

StateTTFB (Dhaka)PageSpeed mobileLCPSpeed Index
No cache plugin0.759 s972.5 s3.3 s
Disk: Basic0.246 s–––
Disk: Enhanced + include0.233 s–––
Full (Enhanced + Minify Auto + Redis + Lazy Load)0.230 s981.7 s3.6 s
PageSpeed Insights mobile 98 with LCP 1.7 s using these W3 Total Cache settings
Full setup: 98, LCP 1.7 s.

Two honest notes. Speed Index got worse (3.3 → 3.6 s) even as LCP improved; I don’t have a clear cause; Speed Index moves between runs, and the other plugins on the same site ranged from 1.1 to 2.3 s. And PageSpeed still flagged about 11 KiB of unused CSS, from one of W3TC’s minified CSS files. Removing unused CSS is a Pro feature. I didn’t measure page weight on the test page with W3TC (my screenshot was of the homepage), so I don’t quote one.

To confirm W3TC is serving your pages, open the page source logged out and scroll to the bottom. Mine said “Object Caching 19/72 objects using Redis” and “Page Caching using Disk: Enhanced”. More ways to check are in how to check if WordPress cache is working.

W3 Total Cache footer comment showing Redis object caching and Disk Enhanced page caching
The footprint at the bottom of the page source.

Problems I hit (and fixes)

  • Restart notice: W3TC shows it whenever it rewrites nginx.conf (changing the page cache method, enabling minify). Reload Nginx each time.
  • PHP 8.5 warning on the dashboard: “Undefined property … license_status”. Cosmetic; caching worked.
  • Clearing caches: Performance → Dashboard → empty all caches, or the admin bar menu. After a theme change, empty all caches and also purge Cloudflare if it caches anything.
W3 Total Cache dashboard with the empty all caches button
Dashboard: empty all caches.

Removing W3 Total Cache safely

Do it in this order: switch Page Cache to Disk: Basic and turn off Object Cache, empty all caches, delete the include line from your Nginx config, deactivate and delete the plugin, delete nginx.conf from the site root, then flush only its Redis database: check it with redis-cli -n 9 dbsize, then run redis-cli -n 9 flushdb, using your number. Never leave out -n: without it, flushdb empties database 0, which may belong to another site. Finally, check wp-content for advanced-cache.php, object-cache.php and db.php, and delete wp-content/cache and wp-content/w3tc-config if they’re still there. If you delete nginx.conf but leave the include line, Nginx fails its next config test. Full details in the advanced-cache.php guide.

W3 Total Cache review: is it still worth using?

For a self-managed Nginx VPS, yes. Its free version gave me everything WP Super Cache and WP Fastest Cache do plus lazy load, JS minify and Redis object cache, and it’s the only one of the three that served cached pages without PHP in my Nginx test (WP Super Cache in Simple mode and WP Fastest Cache both went through PHP). Same-server numbers are in my WP Super Cache vs W3 Total Cache vs WP Fastest Cache test.

For shared hosting or anyone who doesn’t want to touch server config, it’s more plugin than you need: a dozen settings pages, notices, and a manual Nginx step you have to remember to undo. Pro ($99 a year for one site, $350 for 5, $500 for 10, with a 30-day money-back guarantee) adds delay scripts and unused CSS removal; at that price, compare it with WP Rocket, which tied W3TC on TTFB and reached LCP 1.1 s with Remove Unused CSS on, on the same site (WP Rocket vs W3 Total Cache).

Pros and cons

  • ✅ Most complete free cache plugin I tested
  • ✅ Disk: Enhanced lets Nginx serve pages without PHP
  • ✅ Redis object cache built in
  • ❌ Nginx needs a manual include line and reloads
  • ❌ Unused CSS removal and delay JS are Pro only
  • ❌ PHP 8.5 dashboard warning in 2.11.0

FAQ

What are the best W3 Total Cache settings?

For most sites: Page Cache on (Disk: Enhanced if your server rules are in place, otherwise Disk: Basic), Minify on Auto, Database Cache off, Object Cache on only if you have Redis or Memcached, Browser Cache on, and Lazy Load on in User Experience. On my Nginx test site that gave 0.230 s TTFB and PageSpeed mobile 98.

Does W3 Total Cache work with Nginx?

Yes, but Disk: Enhanced and Minify write their rules to an nginx.conf file in your site root, and Nginx ignores it until you add an include line for it in your server block and reload Nginx. Without that, use Disk: Basic.

Disk: Basic or Disk: Enhanced?

Disk: Enhanced if you can add the server rules. In W3TC’s own test on my server it averaged 288 ms vs 382 ms for Disk: Basic, and after including the rules Nginx served cached pages without PHP. Disk: Basic needs no server changes.

Should I enable Database Cache in W3 Total Cache?

Usually no. W3 Total Cache’s Setup Guide says to leave it disabled unless you use Redis or Memcached, because the database server may be faster than disk caching. Use Object Cache with Redis instead if you have it.

Is W3 Total Cache free?

Yes. Page cache, minify, object and database cache, browser cache, lazy load, CDN and limited WebP conversion are free. Pro costs $99 a year for one site and adds delay scripts, remove unused CSS/JS, fragment cache and Full Site Delivery.

How do I clear the W3 Total Cache cache?

Use Performance → Dashboard → empty all caches, or the Performance menu in the admin bar. If Cloudflare or another CDN caches your HTML, purge it there too.

Related Guides