Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Configuration directives (same location syntax)
===============================================
fastcgi_cache_purge
-------------------
* **syntax**: `fastcgi_cache_purge on|off|<method> [from all|<ip> [.. <ip>]]`
* **syntax**: `fastcgi_cache_purge on|off|<method> [purge_all] [from all|<ip> [.. <ip>]]`
* **default**: `none`
* **context**: `http`, `server`, `location`

Expand All @@ -27,7 +27,7 @@ Allow purging of selected pages from `FastCGI`'s cache.

proxy_cache_purge
-----------------
* **syntax**: `proxy_cache_purge on|off|<method> [from all|<ip> [.. <ip>]]`
* **syntax**: `proxy_cache_purge on|off|<method> [purge_all] [from all|<ip> [.. <ip>]]`
* **default**: `none`
* **context**: `http`, `server`, `location`

Expand All @@ -36,7 +36,7 @@ Allow purging of selected pages from `proxy`'s cache.

scgi_cache_purge
----------------
* **syntax**: `scgi_cache_purge on|off|<method> [from all|<ip> [.. <ip>]]`
* **syntax**: `scgi_cache_purge on|off|<method> [purge_all] [from all|<ip> [.. <ip>]]`
* **default**: `none`
* **context**: `http`, `server`, `location`

Expand All @@ -45,7 +45,7 @@ Allow purging of selected pages from `SCGI`'s cache.

uwsgi_cache_purge
-----------------
* **syntax**: `uwsgi_cache_purge on|off|<method> [from all|<ip> [.. <ip>]]`
* **syntax**: `uwsgi_cache_purge on|off|<method> [purge_all] [from all|<ip> [.. <ip>]]`
* **default**: `none`
* **context**: `http`, `server`, `location`

Expand Down Expand Up @@ -90,6 +90,18 @@ uwsgi_cache_purge
Sets area and key used for purging selected pages from `uWSGI`'s cache.



Partial Keys
============
Sometimes it's not possible to pass the exact key cache to purge a page. For example; when the content of a cookie or the params are part of the key.
You can specify a partial key adding an asterisk at the end of the URL.

curl -X PURGE /page*

The asterisk must be the last character of the key, so you **must** put the $uri variable at the end.



Sample configuration (same location syntax)
===========================================
http {
Expand All @@ -106,6 +118,22 @@ Sample configuration (same location syntax)
}


Sample configuration (same location syntax - purge all cached files)
====================================================================
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;
proxy_cache_purge PURGE purge_all from 127.0.0.1;
}
}
}


Sample configuration (separate location syntax)
===============================================
http {
Expand Down
Loading