summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_upstream.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2014-06-26 02:27:11 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2014-06-26 02:27:11 +0400
commit8f9fb9570efceb1ff2376289628cf03b8e4bea76 (patch)
treef50b9d0a6c83a44518e798d6394eda7d7a7ba1de /src/http/ngx_http_upstream.c
parentfeb1649049e777b11ccddad703e8e36e7821d529 (diff)
downloadnginx-8f9fb9570efceb1ff2376289628cf03b8e4bea76.tar.gz
nginx-8f9fb9570efceb1ff2376289628cf03b8e4bea76.tar.bz2
Entity tags: explicit flag to skip not modified filter.
Previously, last_modified_time was tested against -1 to check if the not modified filter should be skipped. Notably, this prevented nginx from additional If-Modified-Since (et al.) checks on proxied responses. Such behaviour is suboptimal in some cases though, as checks are always skipped on responses from a cache with ETag only (without Last-Modified), resulting in If-None-Match being ignored in such cases. Additionally, it was not possible to return 412 from the If-Unmodified-Since if last modification time was not known for some reason. This change introduces explicit r->disable_not_modified flag instead, which is set by ngx_http_upstream_process_headers().
Diffstat (limited to '')
-rw-r--r--src/http/ngx_http_upstream.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 8922dbc8b..5b55b263b 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2238,6 +2238,8 @@ ngx_http_upstream_process_headers(ngx_http_request_t *r, ngx_http_upstream_t *u)
r->headers_out.content_length_n = u->headers_in.content_length_n;
+ r->disable_not_modified = !u->cacheable;
+
u->length = -1;
return NGX_OK;