Proxy_cache regexp batch purge modules 0.2

Download

http://m-b.cc/share/ngx_batch_purge-0.2.tar.gz

About

nginx_cache_batchpurge is ‘nginx’ module which adds regex batch purge
content
from ‘proxy’ caches, and is base on ngx_cache_purge.

Notice

This module is use only for batch purge, if you want to purge a single
object,
please install ngx_cache_purge module, this module can work with that
module
exists.

Install

./configure --add-module=…/ngx_batch_purge-0.2

Configuration directives

proxy_cache_purge

  • syntax: proxy_cache_batchpurge zone_name key
  • default: none
  • context: location

Sets area and key used for purging selected pages from proxy's cache.

Sample configuration

http {
    proxy_cache_path  /tmp/cache  keys_zone=tmpcache:10m;

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

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

        location ~ /regex_purge(.*) {
            allow              127.0.0.1;
            deny               all;
            proxy_cache_batchpurge  tmpcache $1$is_args$args;
        }
    }
}


MagicBear

because nginx is not threadsafe, it will cause segment failure for
this version. Bad news. Need to continue improve.

2011/11/17 MagicBear [email protected]:

Great jog, please keep updating and supporting this module, because this
a great feature for many nginx users.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,218483,219397#msg-219397