diff src/http/ngx_http_upstream.c @ 2662:40f9def49ed5

cache GET requests only
author Igor Sysoev <igor@sysoev.ru>
date Fri, 03 Apr 2009 12:06:04 +0000
parents 3a8a53c0c42f
children 09725d69cb25
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -531,6 +531,10 @@ ngx_http_upstream_cache(ngx_http_request
     ngx_int_t          rc;
     ngx_http_cache_t  *c;
 
+    if (!(r->method & NGX_HTTP_GET)) {
+        return NGX_DECLINED;
+    }
+
     c = ngx_pcalloc(r->pool, sizeof(ngx_http_cache_t));
     if (c == NULL) {
         return NGX_ERROR;