comparison src/http/ngx_http_upstream.c @ 5735:5fb1e57c758a

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().
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 26 Jun 2014 02:27:11 +0400
parents d0ce06cb9be1
children 44b9ab7752e3
comparison
equal deleted inserted replaced
5734:af229f8cf987 5735:5fb1e57c758a
2236 r->headers_out.status = u->headers_in.status_n; 2236 r->headers_out.status = u->headers_in.status_n;
2237 r->headers_out.status_line = u->headers_in.status_line; 2237 r->headers_out.status_line = u->headers_in.status_line;
2238 2238
2239 r->headers_out.content_length_n = u->headers_in.content_length_n; 2239 r->headers_out.content_length_n = u->headers_in.content_length_n;
2240 2240
2241 r->disable_not_modified = !u->cacheable;
2242
2241 u->length = -1; 2243 u->length = -1;
2242 2244
2243 return NGX_OK; 2245 return NGX_OK;
2244 } 2246 }
2245 2247