Skip to content

Commit 822a28c

Browse files
committed
Add alternative "same location" syntax.
Change-Id: I70c89275010fa8ba5f22d62dd15de72ee36d1e33 Signed-off-by: Piotr Sikora <[email protected]>
1 parent 5f4e93d commit 822a28c

File tree

4 files changed

+794
-45
lines changed

4 files changed

+794
-45
lines changed

README.md

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,47 @@ releases:
2323
- 1.3.x (tested with 1.3.0 to 1.3.9).
2424

2525

26-
Configuration directives
27-
========================
26+
Configuration directives (same location syntax)
27+
===============================================
28+
fastcgi_cache_purge
29+
-------------------
30+
* **syntax**: `fastcgi_cache_purge on|off|<method> [from all|<ip> [.. <ip>]]`
31+
* **default**: `none`
32+
* **context**: `location`
33+
34+
Allow purging of selected pages from `FastCGI`'s cache.
35+
36+
37+
proxy_cache_purge
38+
-----------------
39+
* **syntax**: `fastcgi_cache_purge on|off|<method> [from all|<ip> [.. <ip>]]`
40+
* **syntax**: `proxy_cache_purge zone_name key`
41+
* **default**: `none`
42+
* **context**: `location`
43+
44+
Allow purging of selected pages from `proxy`'s cache.
45+
46+
47+
scgi_cache_purge
48+
----------------
49+
* **syntax**: `scgi_cache_purge on|off|<method> [from all|<ip> [.. <ip>]]`
50+
* **default**: `none`
51+
* **context**: `location`
52+
53+
Allow purging of selected pages from `SCGI`'s cache.
54+
55+
56+
uwsgi_cache_purge
57+
-----------------
58+
* **syntax**: `uwsgi_cache_purge on|off|<method> [from all|<ip> [.. <ip>]]`
59+
* **default**: `none`
60+
* **context**: `location`
61+
62+
Allow purging of selected pages from `uWSGI`'s cache.
63+
64+
65+
Configuration directives (separate location syntax)
66+
===================================================
2867
fastcgi_cache_purge
2968
-------------------
3069
* **syntax**: `fastcgi_cache_purge zone_name key`
@@ -61,8 +100,24 @@ uwsgi_cache_purge
61100
Sets area and key used for purging selected pages from `uWSGI`'s cache.
62101

63102

64-
Sample configuration
65-
====================
103+
Sample configuration (same location syntax)
104+
===========================================
105+
http {
106+
proxy_cache_path /tmp/cache keys_zone=tmpcache:10m;
107+
108+
server {
109+
location / {
110+
proxy_pass http://127.0.0.1:8000;
111+
proxy_cache tmpcache;
112+
proxy_cache_key $uri$is_args$args;
113+
proxy_cache_purge PURGE from 127.0.0.1;
114+
}
115+
}
116+
}
117+
118+
119+
Sample configuration (separate location syntax)
120+
===============================================
66121
http {
67122
proxy_cache_path /tmp/cache keys_zone=tmpcache:10m;
68123

TODO.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
Features that sooner or later will be added to `ngx_cache_purge`:
2-
3-
* Add support for alternative in-location cache purges using specified
4-
request method, with following configuration syntax:
5-
6-
location / {
7-
proxy_pass http://127.0.0.1:8000;
8-
proxy_cache tmpcache;
9-
proxy_cache_key $uri$is_args$args;
10-
proxy_cache_purge DELETE from 127.0.0.1;
11-
}
12-
13-
This will allow for purges using:
14-
15-
curl -X DELETE http://example.com/logo.jpg
16-
17-
instead of:
18-
19-
curl http://example.com/purge/logo.jpg
20-
21-
221
Features that __will not__ be added to `ngx_cache_purge`:
232

243
* Support for prefixed purges (`/purge/images/*`).

0 commit comments

Comments
 (0)