]> git.kaiwu.me - nginx.git/commitdiff
clean cache updating state if a response has uncacheable code or
authorIgor Sysoev <igor@sysoev.ru>
Fri, 4 Sep 2009 09:57:38 +0000 (09:57 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 4 Sep 2009 09:57:38 +0000 (09:57 +0000)
cache prohibitive headers

src/http/ngx_http_upstream.c

index 9aa797ac06cbeca732543daca1623dd91a8bf653..6f15c044d0cb02c6aac42d9c718deea772507a9d 100644 (file)
@@ -2113,6 +2113,10 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
     ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
                    "http cacheable: %d", u->cacheable);
 
+    if (u->cacheable == 0 && r->cache) {
+        ngx_http_file_cache_free(r, u->pipe->temp_file);
+    }
+
 #endif
 
     p = u->pipe;