MINOR: cache: Process the If-Modified-Since header in conditional requests
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Fri, 23 Oct 2020 08:51:28 +0000 (10:51 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 27 Oct 2020 17:10:25 +0000 (18:10 +0100)
commit53161d81b87e7953840f8e2c7453d7fd12cb6d13
tree4a5b0284ad1d5e3be7aa3c07ac8b71936f06caeb
parent27091b4dd0612ca420d894342f58ba4087b41350
MINOR: cache: Process the If-Modified-Since header in conditional requests

If a client sends a conditional request containing an If-Modified-Since
header (and no If-None-Match header), we try to compare the date with
the one stored in the cache entry (coming either from a Last-Modified
head, or a Date header, or corresponding to the first response's
reception time). If the request's date is earlier than the stored one,
we send a "304 Not Modified" response back. Otherwise, the stored is sent
(through a 200 OK response).

This resolves GitHub issue #821.
reg-tests/cache/if-modified-since.vtc [new file with mode: 0644]
src/cache.c