diff src/http/ngx_http_upstream.c @ 3083:ffe8bfb38184

clean cache updating state if a response has uncacheable code or cache prohibitive headers
author Igor Sysoev <igor@sysoev.ru>
date Fri, 04 Sep 2009 09:57:38 +0000
parents d22afd261e72
children 5ddc9458e4bb
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2113,6 +2113,10 @@ ngx_http_upstream_send_response(ngx_http
     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;