Mercurial > hg > nginx
comparison src/http/ngx_http_file_cache.c @ 5935:1573fc7875fa
Cache: send conditional requests only for cached 200/206 responses.
RFC7232 says:
The 304 (Not Modified) status code indicates that a conditional GET
or HEAD request has been received and would have resulted in a 200
(OK) response if it were not for the fact that the condition
evaluated to false.
which means that there is no reason to send requests with "If-None-Match"
and/or "If-Modified-Since" headers for responses cached with other status
codes.
Also, sending conditional requests for responses cached with other status
codes could result in a strange behavior, e.g. upstream server returning
304 Not Modified for cached 404 Not Found responses, etc.
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
author | Piotr Sikora <piotr@cloudflare.com> |
---|---|
date | Wed, 26 Nov 2014 18:35:37 -0800 |
parents | f436e9a60b8f |
children | 610832763648 |
comparison
equal
deleted
inserted
replaced
5934:2c33ed82cde1 | 5935:1573fc7875fa |
---|---|
175 | 175 |
176 r->cache = c; | 176 r->cache = c; |
177 c->file.log = r->connection->log; | 177 c->file.log = r->connection->log; |
178 c->file.fd = NGX_INVALID_FILE; | 178 c->file.fd = NGX_INVALID_FILE; |
179 | 179 |
180 c->last_modified = -1; | |
181 | |
180 return NGX_OK; | 182 return NGX_OK; |
181 } | 183 } |
182 | 184 |
183 | 185 |
184 ngx_int_t | 186 ngx_int_t |