1.3.x if-none-match only works if las-modified set
mdounin at mdounin.ru
Mon Mar 11 17:40:57 UTC 2013
On Mon, Mar 11, 2013 at 01:04:32PM -0400, Brian Akins wrote:
> in ngx_http_not_modified_header_filter
> if (r->headers_out.status != NGX_HTTP_OK
> || r != r->main
> || r->headers_out.last_modified_time == -1)
> So, it only checks if-match or if-none-match if last-modified is set.
> Is this on purpose? I'm just wondering if we want to be able to check
> etime without checking last-modified.
The following commit log suggests it was done intentionally,
: Note that the "r->headers_out.last_modified_time == -1" check in the not
: modified filter is left as is intentionally. It's to prevent handling
: of If-* headers in case of proxy without cache (much like currently
: done with If-Modified-Since).
Changing the code to work with ETag from cache without
Last-Modified being present in a cached response should be
possible, but it will require some additional changes.
More information about the nginx-devel