changeset 1028:e582a10b1917

Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
author Vladimir Homutov <vl@nginx.com>
date Mon, 02 Dec 2013 15:24:51 +0400
parents dd64ce140de2
children ad2fc80ac32e
files xml/en/docs/http/ngx_http_fastcgi_module.xml xml/en/docs/http/ngx_http_proxy_module.xml
diffstat 2 files changed, 106 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_fastcgi_module.xml	Wed Oct 23 13:36:17 2013 +0400
+++ b/xml/en/docs/http/ngx_http_fastcgi_module.xml	Mon Dec 02 15:24:51 2013 +0400
@@ -10,7 +10,7 @@
 <module name="Module ngx_http_fastcgi_module"
         link="/en/docs/http/ngx_http_fastcgi_module.html"
         lang="en"
-        rev="12">
+        rev="13">
 
 <section id="summary">
 
@@ -368,6 +368,58 @@
 </directive>
 
 
+<directive name="fastcgi_cache_purge">
+<syntax>string ...</syntax>
+<default/>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+<appeared-in>1.5.7</appeared-in>
+
+<para>
+Defines conditions under which the request will be considered a cache
+purge request.
+If at least one value of the string parameters is not empty and is not equal
+to “0” then the cache entry with a corresponding
+<link id="fastcgi_cache_key">cache key</link> is removed.
+The result of successful operation is indicated by returning
+the <http-status code="204" text="No Content"/> response.
+</para>
+
+<para>
+If the <link id="fastcgi_cache_key">cache key</link> of a purge request ends
+with an asterisk (“<literal>*</literal>”), all cache entries matching the
+wildcard key will be removed from the cache.
+</para>
+
+<para>
+Example configuration:
+<example>
+fastcgi_cache_path /data/nginx/cache keys_zone=cache_zone:10m;
+
+map $request_method $purge_method {
+    PURGE   1;
+    default 0;
+}
+
+server {
+    ...
+    location / {
+        fastcgi_pass backend;
+        fastcgi_cache cache_zone;
+        fastcgi_cache_key $uri;
+        fastcgi_cache_purge $purge_method;
+    }
+}
+</example>
+<note>
+This functionality is available as part of our <commercial_version/> only.
+</note>
+</para>
+
+</directive>
+
+
 <directive name="fastcgi_cache_revalidate">
 <syntax><literal>on</literal> | <literal>off</literal></syntax>
 <default>off</default>
--- a/xml/en/docs/http/ngx_http_proxy_module.xml	Wed Oct 23 13:36:17 2013 +0400
+++ b/xml/en/docs/http/ngx_http_proxy_module.xml	Mon Dec 02 15:24:51 2013 +0400
@@ -10,7 +10,7 @@
 <module name="Module ngx_http_proxy_module"
         link="/en/docs/http/ngx_http_proxy_module.html"
         lang="en"
-        rev="16">
+        rev="17">
 
 <section id="summary">
 
@@ -366,6 +366,58 @@
 </directive>
 
 
+<directive name="proxy_cache_purge">
+<syntax>string ...</syntax>
+<default/>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+<appeared-in>1.5.7</appeared-in>
+
+<para>
+Defines conditions under which the request will be considered a cache
+purge request.
+If at least one value of the string parameters is not empty and is not equal
+to “0” then the cache entry with a corresponding
+<link id="proxy_cache_key">cache key</link> is removed.
+The result of successful operation is indicated by returning
+the <http-status code="204" text="No Content"/> response.
+</para>
+
+<para>
+If the <link id="proxy_cache_key">cache key</link> of a purge request ends
+with an asterisk (“<literal>*</literal>”), all cache entries matching the
+wildcard key will be removed from the cache.
+</para>
+
+<para>
+Example configuration:
+<example>
+proxy_cache_path /data/nginx/cache keys_zone=cache_zone:10m;
+
+map $request_method $purge_method {
+    PURGE   1;
+    default 0;
+}
+
+server {
+    ...
+    location / {
+        proxy_pass http://backend;
+        proxy_cache cache_zone;
+        proxy_cache_key $uri;
+        proxy_cache_purge $purge_method;
+    }
+}
+</example>
+<note>
+This functionality is available as part of our <commercial_version/> only.
+</note>
+</para>
+
+</directive>
+
+
 <directive name="proxy_cache_revalidate">
 <syntax><literal>on</literal> | <literal>off</literal></syntax>
 <default>off</default>