FastCGI caching can make anonymous WordPress pages much faster by storing the PHP response in Nginx instead of running WordPress for every request. Configure the cache zone in Nginx’s http block, enable it only for safe public responses in the PHP location, bypass personalized or state-changing requests, and connect publishing events to a protected purge mechanism. The result should be an anonymous request that changes from MISS to HIT without ever serving one visitor’s private page to another.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
What FastCGI caching does in a WordPress stack
A normal uncached request travels through Nginx to PHP-FPM, where WordPress loads plugins, queries the database, renders the page and sends HTML back. FastCGI caching stores that generated response in an Nginx cache zone. Later public requests can be answered from the cache without starting PHP for each visitor. As the WordPress Advanced Administration Handbook puts it, “Nginx can perform caching on its own end to reduce load on your server.” See the WordPress Nginx administration guidance.
As an Amazon Associate I earn from qualifying purchases.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchThis is page output caching, not browser caching and not an object cache such as Redis. It belongs in Nginx configuration, while WordPress remains responsible for generating the response. Because cached HTML is shared, the key and bypass rules determine whether the right response is served to the right request.
What should normally be cached
- Public front-page, post, page and archive responses requested with GET or HEAD.
- Responses that do not depend on a logged-in user, cart, session, preview, comment form or authorization header.
- Successful responses whose freshness period is acceptable for your publishing workflow.
What should normally bypass the cache
- POST and other state-changing methods.
- Requests carrying login, password-protection, commenter or explicit no-cache cookies.
- Administration, login, cron, XML-RPC, comment-submission, preview, search, feed, REST and other plugin-specific endpoints when their output is dynamic.
- WooCommerce cart, checkout and account pages, membership dashboards, multilingual session routes and any URL that can contain private data.
Prerequisites and decisions before editing Nginx
- Confirm that the site is served by Nginx and that PHP requests are handled by PHP-FPM or another FastCGI backend. Apache-only directives will not configure this cache.
- Locate the active virtual-server file and identify the
locationblock that passes.phprequests to PHP-FPM. Distribution packages commonly include files from/etc/nginx/conf.d/or/etc/nginx/sites-enabled/, but the active path varies. - Back up the working configuration and note the PHP-FPM socket or TCP address. The sample below uses a PHP 8.3 Unix socket; substitute the socket exposed by your installation.
- Choose a cache directory on a filesystem with sufficient space. The Nginx worker must be able to create and write cache files there.
- List every feature that personalizes HTML. The WordPress core exclusions are only a starting point; plugins can add cookies, query parameters and routes that require their own bypass rules.
Decide how quickly edits must appear. A longer time-to-live reduces PHP and database work but makes a missing purge more visible. A shorter time-to-live limits staleness but increases origin traffic. Start conservatively, verify behavior, then tune using logs and server load rather than an assumed speed percentage.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Define the cache zone in the http block
fastcgi_cache_path creates the on-disk cache and shared metadata zone. It must be inside Nginx’s top-level http {} context, not inside a server or location block. This example keeps one hour of inactivity, permits up to 2 GB of cache files and allocates 100 MB for the key zone:
http {
fastcgi_cache_path /var/cache/nginx/wordpress levels=1:2
keys_zone=WORDPRESS:100m inactive=60m max_size=2g;
# Bypass non-cacheable methods.
map $request_method $skip_method {
default 1;
GET 0;
HEAD 0;
}
# This policy bypasses every URL with a query string.
map $query_string $skip_query {
default 1;
"" 0;
}
# WordPress cookies that indicate a private or user-specific response.
map $http_cookie $skip_cookie {
default 0;
~*wordpress_logged_in 1;
~*wordpress_no_cache 1;
~*wp-postpass 1;
~*comment_author_ 1;
}
# Core paths and endpoints that should not use shared page output.
map $request_uri $skip_path {
default 0;
~^/wp-admin/ 1;
~^/wp-login.php 1;
~^/wp-cron.php 1;
~^/xmlrpc.php 1;
~^/wp-comments-post.php 1;
~^/wp-json/ 1;
~*preview=true 1;
}
}
The names and sizes are examples, not universal requirements. Change the directory, zone size, inactivity period and maximum size to match your disk and traffic. Ensure the directory exists and is writable by the Nginx worker; otherwise requests will continue to miss or Nginx will report cache-file errors.
Recommended Free Tools
Choose a cache key deliberately
The key must distinguish every response variant that can differ. A practical starting expression is:
fastcgi_cache_key "$scheme$request_method$host$request_uri";
This preserves scheme, HTTP method, host and the complete requested URI, including its query string. The method dimension keeps GET and HEAD entries separate. If your site deliberately normalizes HEAD to GET or varies output by another dimension, design that behavior explicitly and use the identical expression in purge rules. Never collapse multiple hostnames, HTTP and HTTPS, language variants or meaningful query parameters into one key unless the application guarantees that their HTML is identical.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
The sample policy bypasses all query strings, which is safer for search, tracking and plugin parameters. If you later cache selected query-string URLs, keep the arguments in the key and create an allow-list rather than removing them indiscriminately.
Enable FastCGI caching in the WordPress PHP location
Add caching to the existing PHP location after confirming that the normal FastCGI parameters still reach PHP-FPM:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →location ~ .php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_cache WORDPRESS;
fastcgi_cache_methods GET HEAD;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
# Cache successful public pages; keep error responses brief.
fastcgi_cache_valid 200 10m;
fastcgi_cache_valid 404 1m;
# Any non-zero value bypasses serving a cached response.
fastcgi_cache_bypass $skip_method $skip_query $skip_cookie $skip_path $http_authorization;
# The same conditions prevent a response from being stored.
fastcgi_no_cache $skip_method $skip_query $skip_cookie $skip_path $http_authorization;
# Temporary diagnostic header; remove or restrict it after verification.
add_header X-FastCGI-Cache $upstream_cache_status always;
}
fastcgi_cache selects the zone defined earlier. fastcgi_cache_methods limits eligible methods, while the two bypass directives provide separate protection: fastcgi_cache_bypass stops Nginx from serving an existing entry, and fastcgi_no_cache stops the current response from being stored. Use both. A request that bypasses an old entry must not populate the shared cache with a personalized response.
The example caches status 200 for ten minutes and 404 for one minute. Those are conservative starting values for this configuration, not a promise that every site should use them. Redirects are intentionally omitted until canonicalization, language negotiation and HTTPS behavior are understood. Add a status-specific rule only after testing that it cannot preserve the wrong host, scheme or locale.
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
Keep WordPress’s normal PHP handling intact
Do not replace an existing working try_files, include, fastcgi_param or fastcgi_pass line merely to add caching. A missing SCRIPT_FILENAME can break PHP execution, while a wrong socket can produce 502 errors that have nothing to do with the cache. Insert the cache directives into the site’s established PHP location and preserve its security restrictions.
WordPress bypass rules you should adapt
The WordPress handbook example excludes POST requests, query-string requests, administrative and login paths, special PHP endpoints and cookies including wordpress_logged_in, wordpress_no_cache, wp-postpass and commenter cookies. The maps above implement that general approach, but production sites need an inventory of their own plugins and themes.
Cookies and authorization
A logged-in cookie is an obvious signal, but it is not the only one. Membership, consent, experiment, cart and language plugins may set different names. Inspect response headers and plugin documentation, then add narrowly matched cookie patterns to $skip_cookie. The $http_authorization condition in the location also prevents caching requests that carry an Authorization header.
Query strings and special routes
Skipping every query string avoids accidentally sharing search results, previews or tracking-dependent output. If analytics parameters are the only reason a URL has a query string, normalize them before caching only when you can prove that the resulting HTML is unchanged. Add search, feed, REST, preview, AJAX and custom endpoints to $skip_path when their output is not a public, reusable page.
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
Commerce and membership
Never apply a public-page policy blindly to cart, checkout, account, subscription or member-only routes. These pages often use sessions and Set-Cookie headers. Bypass them by path and cookie, and test both anonymous and authenticated flows after every rule change.
How response headers affect storage
Nginx’s FastCGI module evaluates application and proxy headers while deciding whether and how long to cache. X-Accel-Expires, Expires, Cache-Control, Set-Cookie and Vary can change cache behavior. The module documentation describes these controls and the related directives at Nginx’s FastCGI module reference.
Let authoritative application headers do their job. In particular, do not add fastcgi_ignore_headers Set-Cookie merely to increase hit rates. Ignoring a cookie header can turn a private or session-bound response into shared content. Use an ignore directive only after auditing the application and proving that the response is safe for every visitor.
Likewise, do not override Vary or cache-control directives until you understand which representation they protect. A cache hit is useful only when the bytes are correct for the requesting variant.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Validate syntax, permissions and the first cache hit
- Check the configuration before reloading:
sudo nginx -tProceed only when Nginx reports that the syntax test is successful.
- Reload without stopping active connections:
sudo systemctl reload nginxUse the service manager appropriate to your operating system.
- Confirm that
/var/cache/nginx/wordpressexists, is writable by the Nginx worker, and has free space. Check the Nginx error log if cache files are not being created. - Request an anonymous public URL twice:
curl -I https://example.com/sample-page curl -I https://example.com/sample-pageWith the diagnostic header enabled, the first request should normally report
X-FastCGI-Cache: MISSand the next should reportHIT, provided no bypass condition applies. - Repeat the test with a logged-in browser, a request carrying a WordPress cookie, a POST, a URL with a query string, an admin path and a preview. These should bypass or avoid storage rather than reuse the anonymous entry.
- Check the origin logs and PHP-FPM activity. A hit should not invoke WordPress for the page, while a bypass should still reach PHP and must not create a shared entry.
If exposing cache status publicly is undesirable, log $upstream_cache_status in a dedicated access-log format instead of sending the header to every visitor. Remove the diagnostic header after testing or restrict it to an internal environment.
Purge cached pages when WordPress content changes
A ten-minute TTL does not guarantee that a newly published post appears immediately. WordPress recommends integrating a purge mechanism such as Nginx Helper when edits must invalidate page cache. Its Nginx guidance is in the WordPress handbook, and NGINX’s community performance article calls the cache key and purge location especially relevant while recommending WordPress Nginx Helper integration: NGINX community WordPress performance guidance.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteUse the native purge directive only when supported
Nginx’s fastcgi_cache_purge removes entries by cache key, but availability depends on the installed Nginx build. The purge endpoint must also be private. Do not create an unauthenticated URL that anyone can call to flush arbitrary entries.
The purge key must reproduce the cache key exactly. If the cached key is "$scheme$request_method$host$request_uri" and public pages are cached with GET, a protected purge location can use the equivalent GET key for the target path:
location ~ ^/_purge(/.*)$ {
allow 127.0.0.1;
deny all;
fastcgi_cache_purge WORDPRESS "$schemeGET$host$1";
}
This pattern is illustrative: adapt the location, access controls and key to your routing. If your key includes a port, locale, normalized query string or another variable, include the same dimension in the purge expression. Test one known URL and verify that the next anonymous request is a MISS and contains the edited content.
Connect publishing events
Configure your WordPress purge integration to invalidate the edited post, its front page, relevant archives and feeds according to your URL structure. A full-cache purge is simpler but can create a sudden PHP-FPM surge on a busy site. Selective purging preserves warm entries while still removing pages affected by the edit. Protect the integration endpoint and log purge failures so a plugin update or permission change cannot silently leave stale pages online.
Free tools Windows power users keep installed
One-click scans. No signup required.
Troubleshoot a cache that never hits
| Symptom | Likely cause | What to check |
|---|---|---|
Every anonymous request is MISS |
A bypass variable is always non-zero, the method is not GET/HEAD, or the response is not cacheable. | Log the map variables, inspect cookies and query strings, verify fastcgi_cache WORDPRESS, and review response headers. |
| Nginx reports cache-file or permission errors | The path is absent, owned by the wrong user, full, or mounted read-only. | Create the directory, grant the Nginx worker write access, free disk space and inspect the error log. |
| Logged-in users see an anonymous page | The login cookie is not matched or the cookie bypass is applied only to storage, not serving. | Use the same conditions in both fastcgi_cache_bypass and fastcgi_no_cache; add the actual cookie name and purge the exposed entry. |
| Posts remain stale after publishing | No purge event ran, the purge key differs from the cache key, or another cache layer is serving the old response. | Inspect the integration log, compare key expressions character by character, purge the affected URL and check browser/CDN caches separately. |
| Some hosts or languages receive the wrong page | The key omits a dimension that changes output. | Include host, scheme, locale or the approved variant in the key, or bypass that variation entirely. |
| PHP works but the cache directive causes a configuration error | The Nginx build lacks the required module or directive, or the directive is in the wrong context. | Run nginx -V, read the installed module documentation and keep fastcgi_cache_path in http; verify build support for fastcgi_cache_purge separately. |
| POST, comments or checkout behave unpredictably | State-changing routes are being treated as public pages. | Keep method, path, cookie and authorization bypass rules enabled and test the complete workflow, not just its landing page. |
A production verification checklist
- Configuration:
nginx -tsucceeds before every reload, and the active server block contains the intended PHP location. - Storage: The cache directory is writable by Nginx, has enough capacity and is monitored for growth.
- Key integrity: Scheme, host, method and URI dimensions match the site’s actual content variations.
- Anonymous behavior: Two requests to a public URL show MISS followed by HIT, or the equivalent values in logs.
- Privacy: Logged-in, password-protected, cookie-bearing and authorization requests never receive a shared anonymous response.
- State changes: POST, comments, previews, search, feeds, XML-RPC, cart, checkout, account, membership and multilingual routes have been exercised.
- Freshness: Publishing or editing a post invokes the purge integration, and the next anonymous request contains the new content.
- Operations: Monitor hit behavior, PHP-FPM load, disk usage and purge failures before changing TTLs or adding stale-serving policies.
When managed hosting is the practical option
Some site owners do not have permission to edit Nginx or PHP-FPM configuration. A managed WordPress host can be appropriate when it explicitly supports Nginx FastCGI caching, provides a documented purge integration and gives you access to cache-status diagnostics. Confirm the provider’s geography, plan limits, purge behavior and support responsibilities before migrating. If you cannot inspect or test bypass rules, do not enable shared page caching blindly on a site with accounts, commerce or membership data.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

