[patch] cache_purge

Piotr Sikora piotr.sikora at frickle.com
Tue Aug 11 20:42:29 MSD 2009


Hello,
this patch adds ability to purge content from nginx's FastCGI and proxy 
caches.

Idea, as well as funding, came from yo.se.

Example configuration:
---
proxy_cache_path /tmp/cache keys_zone=tmpcache:10m;

location / {
    proxy_pass         http://127.0.0.1:8000;
    proxy_cache        tmpcache;
    proxy_cache_key    $uri;
}

location ~ /purge(/.*) {
    allow              127.0.0.1;
    deny               all;
    proxy_cache_purge  tmpcache   $1;
}
---

allows:
- anyone to GET http://www.site.com/abc from backend
(and store it in nginx's cache),
- users from 127.0.0.1 to purge "/abc" from cache using GET 
http://www.site.com/purge/abc.

Patch against latest nginx (0.8.8):
http://labs.frickle.com/nginx_cache_purge/

Best regards,
Piotr Sikora < piotr.sikora at frickle.com >






More information about the nginx mailing list