cache-purge
Purge entries from proxy and FastCGI caches
Overview
ngx_cache_purge adds cache purging to nginx. It deletes entries from the caches populated by the proxy, FastCGI, uWSGI, and SCGI modules, a capability the open source nginx core does not include.
A purge is triggered by an HTTP request whose computed cache key matches the entry to remove, usually via a dedicated location restricted to trusted addresses. Applications can then invalidate a stale page immediately instead of waiting for the cache entry to expire.
The module was written by Piotr Sikora at FRiCKLE and upstream marks it production ready. It is a common companion to WordPress and other CMS caching plugins.
Key directives
proxy_cache_purgeRemoves an entry from a proxy_cache zone whose key matches the given value.fastcgi_cache_purgeRemoves an entry from a fastcgi_cache zone, the usual choice for PHP-FPM setups.uwsgi_cache_purge / scgi_cache_purgeThe same purge support for caches filled by the uwsgi and scgi modules.Access controlPurge endpoints are ordinary nginx locations, so allow and deny rules decide who may purge.Example
Availability
Ships as a dynamic module in libnginx-mod-http-cache-purge, installed automatically with nginx-extras. The package drops a load_module config into /etc/nginx/modules-enabled/, so it loads on start.