comparison src/http/ngx_http_upstream.c @ 2703:3b6afa999c2f

support 304 for cacheable responses
author Igor Sysoev <igor@sysoev.ru>
date Wed, 15 Apr 2009 11:17:38 +0000
parents 756f73ca1e39
children ac1e2e199c9f
comparison
equal deleted inserted replaced
2702:eace65d6092b 2703:3b6afa999c2f
1956 1956
1957 ngx_http_file_cache_set_header(r, u->buffer.start); 1957 ngx_http_file_cache_set_header(r, u->buffer.start);
1958 1958
1959 } else { 1959 } else {
1960 u->cacheable = 0; 1960 u->cacheable = 0;
1961 r->headers_out.last_modified_time = -1;
1961 } 1962 }
1962 } 1963 }
1963 1964
1964 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, 1965 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
1965 "http cacheable: %d", u->cacheable); 1966 "http cacheable: %d", u->cacheable);
3177 3178
3178 *ho = *h; 3179 *ho = *h;
3179 3180
3180 #if (NGX_HTTP_CACHE) 3181 #if (NGX_HTTP_CACHE)
3181 3182
3182 if (r->cached) { 3183 if (r->cached || r->upstream->cacheable) {
3183 r->headers_out.last_modified = ho; 3184 r->headers_out.last_modified = ho;
3184 r->headers_out.last_modified_time = ngx_http_parse_time(h->value.data, 3185 r->headers_out.last_modified_time = ngx_http_parse_time(h->value.data,
3185 h->value.len); 3186 h->value.len);
3186 } 3187 }
3187 3188