changeset 2703:3b6afa999c2f

support 304 for cacheable responses
author Igor Sysoev <igor@sysoev.ru>
date Wed, 15 Apr 2009 11:17:38 +0000
parents eace65d6092b
children ac1e2e199c9f
files src/http/ngx_http_upstream.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1958,6 +1958,7 @@ ngx_http_upstream_send_response(ngx_http
 
         } else {
             u->cacheable = 0;
+            r->headers_out.last_modified_time = -1;
         }
     }
 
@@ -3179,7 +3180,7 @@ ngx_http_upstream_copy_last_modified(ngx
 
 #if (NGX_HTTP_CACHE)
 
-    if (r->cached) {
+    if (r->cached || r->upstream->cacheable) {
         r->headers_out.last_modified = ho;
         r->headers_out.last_modified_time = ngx_http_parse_time(h->value.data,
                                                                 h->value.len);