diff src/http/ngx_http_upstream.c @ 487:f2c6a7373274 NGINX_0_7_51

nginx 0.7.51 *) Feature: the "try_files" directive supports a response code in the fallback parameter. *) Feature: now any response code can be used in the "return" directive. *) Bugfix: the "error_page" directive made an external redirect without query string; the bug had appeared in 0.7.44. *) Bugfix: if servers listened on several defined explicitly addresses, then virtual servers might not work; the bug had appeared in 0.7.39.
author Igor Sysoev <http://sysoev.ru>
date Sun, 12 Apr 2009 00:00:00 +0400
parents 09f0ef15d544
children 549994537f15
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1945,6 +1945,9 @@ ngx_http_upstream_send_response(ngx_http
         }
     }
 
+    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
+                   "http cacheable: %d", u->cacheable);
+
 #endif
 
     p = u->pipe;
@@ -2746,7 +2749,7 @@ ngx_http_upstream_finalize_request(ngx_h
 
 #if (NGX_HTTP_CACHE)
 
-    if (r->cache) {
+    if (u->cacheable) {
         time_t  valid;
 
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -2768,7 +2771,8 @@ ngx_http_upstream_finalize_request(ngx_h
 
 #endif
 
-    if (u->header_sent && (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE))
+    if (u->header_sent
+        && (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE))
     {
         rc = 0;
     }