NGINX Caching: How to exclude a URL / slug from User Cache

If you have a custom login URL, eCommerce jobs/queries or unique requirements, you can exclude slugs from the NGINX User Cache (ea-nginx).


To achieve this under ea-nginx (acting as proxy in front of Apache/httpd, with NGINX as Reverse Caching Proxy) you need to add a snippet to the website's .htaccess file.

For example, to exclude a specific proposal on a website, you could use:

<If "'%{REQUEST_URI}' =~ m#/proposals/proposal-name/#">
<IfModule mod_headers.c>
Header set Pragma "no-cache"
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
</IfModule>
</If>
  • 0 users found this helpful
Was this answer helpful?

Similar, and hopefully helpful

Website cloning: How to duplicate a WordPress website (cP)

If you're not using a system like WordPress Toolkit for staging, you can easily clone sites...

WP-CLI: Using the command line to update your WordPress install

If you're managing a range of sites, or even a single busy website, WP-CLI can save you valuable...