# Proxy\_cache regexp batch purge modules 0.2

**URL:** <https://www.ruby-forum.com/t/proxy-cache-regexp-batch-purge-modules-0-2/213958>\
**Category:** NGINX\
**Created:** [November 17, 2011, 2:22pm UTC](https://www.ruby-forum.com/t/proxy-cache-regexp-batch-purge-modules-0-2/213958 "2011-11-17T14:22:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [November 17, 2011, 2:22pm UTC](https://www.ruby-forum.com/t/proxy-cache-regexp-batch-purge-modules-0-2/213958/1 "2011-11-17T14:22:56Z")

</div>

# Download

[http://m-b.cc/share/ngx\_batch\_purge-0.2.tar.gz](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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 17, 2011, 4:57pm UTC](https://www.ruby-forum.com/t/proxy-cache-regexp-batch-purge-modules-0-2/213958/2 "2011-11-17T16:57:52Z")

</div>

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

2011/11/17 MagicBear [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 30, 2011, 9:58pm UTC](https://www.ruby-forum.com/t/proxy-cache-regexp-batch-purge-modules-0-2/213958/3 "2011-11-30T21:58:43Z")

</div>

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

Posted at Nginx Forum:

> **[Re: \[MOD\] proxy\_cache regexp batch purge modules 0.2](https://forum.nginx.org/read.php?2,218483,219397#msg-219397)**
>
> 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 =====
