Fix caching
Nginx's std cfg only returns 304 with If-Unmodified-Since header, if the date is exactly the one it expects, not the date the client did its last request. This makes sense as it is much easier to compare two strings for equality than to parse the date received from the client and check the ordering with the server known last_modified value.
This commit is contained in:
parent
3bee93ecb3
commit
85b5c2be89
2 changed files with 4 additions and 4 deletions
|
|
@ -40,8 +40,8 @@ impl Fetcher {
|
|||
if !fetchdata.etag.is_empty() {
|
||||
builder = builder.header("If-None-Match", fetchdata.etag);
|
||||
}
|
||||
if !fetchdata.date.is_empty() {
|
||||
builder = builder.header("If-Modified-Since", fetchdata.date);
|
||||
if !fetchdata.last_modified.is_empty() {
|
||||
builder = builder.header("If-Modified-Since", fetchdata.last_modified);
|
||||
}
|
||||
|
||||
let start_instant = Instant::now();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue