Best WordPress Cache Plugin for Nginx (2026): Tested on an aaPanel VPS
Disclosure: some links on this page are affiliate links (WP Rocket and FlyingPress). If you buy through them, WebPickr may earn a commission at no extra cost to you. WPDeveloper gave us an xSpeed Cache Pro license for testing; they had no input into the results.
The best WordPress cache plugin for Nginx is one that lets Nginx itself send the cached page, without waking up PHP. In my tests on an aaPanel VPS, two plugins did that: xSpeed Cache, which writes the Nginx snippet for you, and the free W3 Total Cache, once its rules are included in the server config. If your site sits behind Cloudflare, FlyingPress is the other strong pick: it serves through PHP on Nginx, but its edge caching skips your server for cached pages.
Nginx changes the choice because it ignores .htaccess. Many cache plugins were written for Apache and rely on .htaccess rules to serve cached files and set browser caching. On Nginx those rules do nothing, so the plugin either falls back to PHP or needs you to add server rules yourself. Below is how each plugin I tested behaves on Nginx, with the response headers that prove it.
Tested by Dolon Bepari, November 8 to 12, 2026, on one article page of a test site: WordPress 7.1.4, PHP 8.5, Kadence, Nginx on an aaPanel VPS in Hong Kong, Cloudflare proxied, measured from Dhaka. Ten cache plugins, one at a time: xSpeed Cache 1.4.7 + Pro 1.3.8, W3 Total Cache 2.11.0, FlyingPress 5.6.7, WP Rocket 3.24, WP Super Cache, WP Fastest Cache 1.5.5, Super Page Cache 5.3.10, Jetpack Boost 4.8.2, WP-Optimize and NitroPack 1.20.4. With no cache plugin, TTFB was 0.615 to 0.759 s depending on the day (re-measured on November 10 and 11). How we test cache plugins.
Quick picks for Nginx
- Best overall on Nginx: xSpeed Cache (free, Pro $58 a year). Generates the Nginx snippet; its header switched from HIT (php) to HIT (nginx).
- Best free: W3 Total Cache with Page Cache on Disk: Enhanced and its nginx.conf included in the server block.
- Best if you use Cloudflare: FlyingPress ($59 a year). PHP path on Nginx, but HTML from Cloudflare’s edge at 0.146 s from Dhaka.
- Avoid on Nginx: LiteSpeed Cache for page caching. Its page cache needs a LiteSpeed server.
Table of Contents
How each WordPress cache plugin serves pages on Nginx (with headers)
This is the table I wish I had found before testing. The “served by” column comes from the response header or page footprint I captured, or from the plugin’s own docs or settings where the row says so. TTFB is the median from Dhaka on the same page, in the state shown; the plugins were tested on different days, and a difference of 0.05 s or less is a tie.
| Plugin | Price (1 site) | What the header or footprint showed | Served by on Nginx | Extra Nginx setup | TTFB (state) |
|---|---|---|---|---|---|
| xSpeed Cache | Free; Pro $58/yr | x-xspeed-cache: HIT (php), then HIT (nginx) | Nginx, after the snippet | Paste its snippet into the site config | ~0.23 s (snippet + Redis) |
| W3 Total Cache | Free; Pro $99/yr | Disk: Basic showed PHP’s x-pingback header; Disk: Enhanced with rules did not | Nginx, with Disk: Enhanced + include | Include its nginx.conf, restart Nginx | 0.233 s (Disk: Enhanced) |
| FlyingPress | $59/yr | x-flying-press-source: PHP | PHP | None needed; optional config in its docs (not tested) | 0.233 s basic, 0.250 s defaults, 0.146 s edge |
| WP Rocket | $60/yr | Its docs: works on Nginx out of the box; extra config lets Nginx skip PHP | PHP by default (per docs) | Optional rocket-nginx config (not tested) | 0.276 s default, 0.234 s basic |
| WP Super Cache | Free | Simple delivery mode, the one it recommends on Nginx | PHP (Simple mode) | Expert mode needs rules the plugin calls not officially supported | 0.27 s (default) |
| WP Fastest Cache | Free; Premium $49 once | Footprint ends with “via php” | PHP | Gzip and browser caching must be set in Nginx | 0.249 s (default) |
| Super Page Cache | Free; Pro $39/yr | x-wp-spc-disk-cache: HIT; cf-cache-status: HIT on the edge | PHP drop-in, or Cloudflare’s edge | Shows Nginx rules for gzip and browser caching | 0.289 s disk, 0.136 s edge |
| Jetpack Boost | Free; paid $239.40/yr | x-jetpack-boost-cache: hit | Not checked | None | 0.267 s (page cache only) |
| WP-Optimize | Free; Premium $49/yr | wpo-cache-status: cached | Not checked | None (says Cloudflare handles headers) | 0.377 s (with Delay JS, 3 min after a purge) |
| NitroPack (free plan) | Free; paid from $84/yr | x-nitro-cache: HIT, x-nitro-cache-from: drop-in | PHP drop-in, assets from its CDN | None | 0.386 s (Strong mode) |
| LiteSpeed Cache | Free | Not tested | Page cache does not run on Nginx | Needs a LiteSpeed server | — |
Does it matter whether Nginx or PHP serves the cache?
For a single visitor far from the server, barely. With W3 Total Cache, the PHP path (Disk: Basic) measured 0.246 s from Dhaka and the Nginx path (Disk: Enhanced) 0.233 s: a tie. Most of that time is the trip between Dhaka and Hong Kong. W3 Total Cache’s own setup test showed a clearer gap: 522.6 ms with no cache, 381.5 ms on Disk: Basic and 288.4 ms on Disk: Enhanced.
xSpeed Cache gave the cleanest server-side numbers. Measured on the VPS itself, its PHP path answered in 9.9 to 12.9 ms and its Nginx path in 6.5 to 7.8 ms. A few milliseconds per request is nothing to one reader, but it adds up when hundreds of requests arrive together, because every PHP request takes a worker. I didn’t run a load test; SpinupWP’s older Nginx benchmark (2023) found the same direction, with plugins serving more requests per second once Nginx rules were added.
So the Nginx path matters most on busy sites and small VPS plans. On a quiet blog, the page-weight and Cloudflare choices in my ranking of the best WordPress cache plugins matter more.
1. xSpeed Cache: the easiest Nginx fast path
WPDeveloper gave us a Pro license for testing; they had no input into the results.
xSpeed Cache (free 1.4.7, Pro 1.3.8 in my test) noticed Nginx in its setup wizard and generated a server snippet: 48 lines in the wizard, and 62 on its Server config card once Pro added the images part, covering page cache, gzip, browser cache and images. In aaPanel I opened Website, then the site’s Config file, and pasted it above the #REWRITE-START line. Its Server config card first said it couldn’t verify the snippet, then switched to Installed. From then on the header read HIT (nginx) instead of HIT (php).


- Good on Nginx: snippet written for you, a header that tells you which path served the page, Redis object cache support.
- Watch out: remove the snippet before you uninstall the plugin, or your Nginx config will point at things that no longer exist. Brotli wasn’t in the snippet.
- Price: free version; Pro $58 a year, $29 at launch pricing (checked November 12, 2026). Full test: xSpeed Cache review.
2. W3 Total Cache: the best free option for Nginx
W3 Total Cache writes its Nginx rules to an nginx.conf file in the WordPress root. Nginx doesn’t load that file by itself: you add an include line for it in the site’s server block, then restart Nginx when W3 Total Cache asks. With Page Cache on Disk: Enhanced and the include in place, PHP’s x-pingback and link headers disappeared from cached responses, which is how you know Nginx is serving the file.


- Good on Nginx: free, page cache served by Nginx, plus object and database cache with Redis.
- Watch out: the include line and the restart are manual, and on shared Nginx hosting you usually can’t edit the server block. On PHP 8.5 its dashboard showed a license_status warning.
- Price: free; Pro $99 a year. Settings: W3 Total Cache settings.
3. FlyingPress: PHP on Nginx, but edge caching beats both paths
FlyingPress doesn’t try to bypass PHP by default; its own header says x-flying-press-source: PHP, and its docs describe an optional Nginx config for sites that want to lower PHP load (I didn’t test that config). It still kept pace: 0.233 s on basic settings and 0.250 s with its defaults. Where it changes the picture is Cloudflare. With an API token it created two Cache Rules and the HTML came from Cloudflare’s edge at 0.146 s, so for cached pages neither Nginx nor PHP did any work.

- Good on Nginx: no server config needed, the lightest page in my tests (119 kB with its defaults), edge caching.
- Watch out: every uncached or logged-in request still goes through PHP.
- Price: $59 a year for one site. More: FlyingPress review · FlyingPress settings with Cloudflare edge caching.
4. WP Rocket: fine on Nginx without changes
WP Rocket’s documentation says it works on Nginx out of the box, and that’s what I saw: no server changes, 0.234 s TTFB on basic settings, PageSpeed 100. By default the cached page goes through PHP; WP Rocket points to a community config (rocket-nginx) for sites that want Nginx to serve its cache directly. I didn’t test that config, so I can’t give you numbers for it.
- Good on Nginx: zero server setup, and the most documentation of any cache plugin.
- Watch out: deactivating it left WP_CACHE set to false in wp-config.php, which blocked the next cache plugin until I fixed it.
- Price: $60 a year for one site ($36 for the first year until November 28, 2026). More: WP Rocket review · WP Rocket settings, tab by tab.
5. WP Super Cache: use Simple mode on Nginx
WP Super Cache’s fastest mode, Expert, works by writing mod_rewrite rules to .htaccess, which Nginx ignores. On Nginx the plugin hides that rules section and points you to Nginx rules that it says are not officially supported. I used Simple mode, which serves cached files through PHP and is the mode the plugin recommends: 0.27 s TTFB on defaults. Free. Setup details are in my WP Super Cache settings guide.
- Good on Nginx: free, nothing to add to the server in Simple mode.
- Watch out: Expert mode needs hand-written Nginx rules; uninstalling left advanced-cache.php and its WP_CACHE line.
6. Super Page Cache: Nginx matters less when Cloudflare serves the HTML
Super Page Cache’s disk cache runs through a PHP drop-in (0.289 s), but its real strength is Cloudflare: it created a Cache Rule and the page came from the edge at 0.136 s, a tie with FlyingPress’s edge result (0.146 s). Its “browser caching rules” toggle only writes .htaccess, so on Nginx the CSS header stayed at 12 hours. To its credit, it shows an Nginx Instructions box with gzip, optional Brotli and browser caching rules to paste into your config.

Free; Pro $39 a year. Full results and settings: my Super Page Cache review. Free download: the plugin page on wordpress.org.
Plugins that fit Nginx less well
- WP Fastest Cache: its footprint ends with “via php”, and its own FAQ tells Nginx users to set gzip and browser caching on the server. Page cache was fine (0.249 s). Free; Premium $49 one-time. See WP Fastest Cache settings.
- LiteSpeed Cache: its page cache only runs on a LiteSpeed or OpenLiteSpeed server. Some Nginx rankings still list it first; on Nginx you would only get its optimization features.
- Jetpack Boost and WP-Optimize: I didn’t check whether either can bypass PHP. WP-Optimize’s static file headers tab simply reported that Cloudflare handles browser caching. Boost’s page cache alone measured 0.267 s; WP-Optimize measured 0.377 s with Delay JavaScript on, about three minutes after a purge. Boost is free (paid $239.40 a year); WP-Optimize Premium is $49 a year.
- NitroPack: serves pages through a PHP drop-in and moves assets to its CDN, so Nginx barely matters; TTFB was 0.386 s on the free plan; paid plans start at $7 a month billed yearly. See my NitroPack review.
Browser caching on Nginx: set it in the server, not the plugin
Most cache plugins’ browser caching options write .htaccess rules, so on Nginx they change nothing. On my aaPanel site the default config already had two expires rules: 30 days for gif, jpg, jpeg, png, bmp and swf, and 12 hours for JS and CSS. WebP wasn’t in the image rule, so WebP files fell back to Cloudflare’s Browser Cache TTL of 4 hours. PageSpeed’s “Use efficient cache lifetimes” audit listed 231 KiB of potential savings.
Super Page Cache showed one more catch here: when I connected it to Cloudflare, it changed my zone’s Browser Cache TTL from 4 hours to “Respect Existing Headers”, so the Nginx expires values became the ones visitors got. It set the TTL back when I disconnected.

For the test I edited those two existing blocks (don’t add second copies below them: Nginx uses the first matching location, so new blocks underneath would be ignored), changing both to 365 days and adding modern formats to the image rule. Afterwards I restored the originals for the next tests.
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|webp|avif|svg|ico|woff|woff2)$
{
expires 365d;
error_log /dev/null;
access_log /dev/null;
}
location ~ .*\.(js|css)?$
{
expires 365d;
error_log /dev/null;
access_log /dev/null;
}
After purging Cloudflare, CSS and WebP both came back with max-age=31536000, and the audit’s savings dropped to 7 KiB (only Cloudflare’s beacon and Gravatar were left). Any change in the PageSpeed score was run-to-run noise, because Lighthouse loads the page with an empty cache. A one-year lifetime is safe for CSS and JS when your theme and plugins add version strings to file URLs, as WordPress normally does. Images in uploads have no version string, so if you replace an image under the same file name, returning visitors may keep the old one; upload a new file name instead. Keep a copy of the original blocks, and if Nginx shows an error after saving, paste them back. My full guide to leverage browser caching on Nginx also covers Apache and Cloudflare.
Nginx FastCGI cache and Nginx Helper: do you still need a plugin?
Nginx can cache pages on its own with FastCGI cache, without any WordPress plugin, and some managed hosts enable it for you. I haven’t tested FastCGI cache on this server, so there are no numbers for it here. What matters for choosing a plugin is how the pieces fit together:
- Nginx Helper (by rtCamp) doesn’t cache anything. It clears the FastCGI or Redis page cache when you publish or update content. Depending on the purge method you choose, it needs either the ngx_cache_purge module or access to the cache folder. See its plugin page.
- With FastCGI cache on, you don’t need a second page cache. Use a plugin only for front-end work (minify, lazy load, Remove Unused CSS), with its page cache turned off.
- Object cache is separate: a Redis object cache speeds up the pages that can’t be cached. Here’s how I set up Redis object cache on aaPanel.
The official WordPress Nginx documentation has example rules for FastCGI cache, WP Super Cache and W3 Total Cache.
How to check which path serves your cached pages
- Open a terminal and run
curl -s -o /dev/null -D - https://yoursite.com/a-post/twice (on Windows, typecurl.exeand use-o NUL). It only reads headers and changes nothing. - Look for the plugin’s header: HIT (nginx) versus HIT (php) for xSpeed, x-flying-press-source for FlyingPress, x-nitro-cache-from for NitroPack.
- If the plugin has no such header, compare against an uncached request: PHP usually adds headers like x-pingback or a link header that a static file served by Nginx won’t have.
- Check cf-cache-status if you use Cloudflare: HIT means the edge served the page and your server did nothing.
For every header and footprint, see my guide to checking whether WordPress cache is working. If you switch plugins, clean up first; my advanced-cache.php guide lists what each plugin left behind.
Best WordPress cache plugin for Nginx: which one to pick
| Your Nginx setup | Pick | Why |
|---|---|---|
| Own VPS with a panel (aaPanel, CloudPanel) and access to the site config | xSpeed Cache, or W3 Total Cache for free | Both let Nginx serve cached pages |
| Behind Cloudflare, visitors in many countries | FlyingPress, or Super Page Cache for free | Edge caching skips your server |
| Want zero server changes | WP Rocket or FlyingPress | Both work on Nginx through PHP with no config |
| Your stack already runs FastCGI cache | Nginx Helper for purging + a front-end plugin with page cache off | Avoid two page caches |
| Managed Nginx host with its own cache | The host’s cache, plus front-end optimization only | The host already serves cached pages |
| Shared Nginx hosting, no access to the server block | WP Rocket, FlyingPress or WP Super Cache in Simple mode | All work through PHP with no server rules |
Not tested (and why)
- LiteSpeed Cache: its page cache needs a LiteSpeed server; mine runs Nginx.
- Nginx FastCGI cache: not set up on this test server yet, so no numbers.
- Nginx Cache (by Till Krüss): a small plugin that purges an existing Nginx cache; it needs Nginx and PHP to run as the same user. Not tested.
- rocket-nginx and FlyingPress’s optional Nginx config: I tested both plugins in their default PHP mode only.
My verdict
On Nginx, I’d pick xSpeed Cache if you’re comfortable pasting a snippet into your site config, and W3 Total Cache if you want the same Nginx fast path for free and don’t mind a longer setup. If your site is on Cloudflare, FlyingPress makes the Nginx question mostly irrelevant, because cached pages come from the edge. Whatever you choose, set browser caching in the Nginx config, not in the plugin, and check the headers to see which path is really serving your pages.
FAQ
Does LiteSpeed Cache work on Nginx?
Only partly. LiteSpeed Cache’s page cache needs a LiteSpeed or OpenLiteSpeed web server, so on Nginx it can’t cache pages. Its other features, such as CSS and JavaScript optimization and image tools, do work on any server. On Nginx, choose a different page cache plugin, or use Nginx FastCGI cache.
Does WP Super Cache work with Nginx?
Yes, in Simple mode, which serves cached files through PHP and is the mode the plugin recommends on Nginx. Its faster Expert mode depends on .htaccess rewrite rules that Nginx ignores; the plugin links to Nginx rules but says they aren’t officially supported. On my test page Simple mode gave 0.27 s TTFB from Dhaka.
Is WP Rocket compatible with Nginx?
Yes. WP Rocket’s documentation says it works on Nginx out of the box, and on my aaPanel server it needed no changes: 0.234 s TTFB and PageSpeed 100. By default its cached pages go through PHP. An optional community config, rocket-nginx, lets Nginx serve them directly; I haven’t tested that.
What does the Nginx Helper plugin do?
Nginx Helper doesn’t cache pages itself. It clears Nginx’s FastCGI cache, or a Redis page cache, when you publish or update content, so visitors don’t see old pages. Depending on the purge method, it needs the ngx_cache_purge module or access to the cache folder. Use it only if your server already runs FastCGI cache; with a normal cache plugin you don’t need it.
Do I need a cache plugin if I use Nginx FastCGI cache?
Not for page caching. FastCGI cache already stores finished pages at server level, and a second page cache can serve stale content. You may still want a plugin for front-end work, like minifying files, lazy loading images or removing unused CSS, with its own page cache turned off, plus Nginx Helper to clear the cache.
How do I know if Nginx is serving the cached page?
Check the response headers with curl or your browser’s DevTools. Some plugins say it directly: xSpeed Cache shows HIT (nginx) or HIT (php). Otherwise, compare with an uncached request: PHP usually adds headers like x-pingback that a static file served by Nginx won’t have. With Cloudflare, cf-cache-status HIT means the edge served it.
