diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2012-03-25 11:29:30 +0200 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2012-03-25 12:57:27 +0200 |
commit | db2f78f8d4641ded7acf26308976fc1216ffa1bb (patch) | |
tree | 951b79c94e662152759fe15dfbfc43b4e5d6a6d9 /main/res | |
parent | 3156aedd92ab76b9727a6108d9a8e9e78b816b63 (diff) | |
download | cgeo-db2f78f8d4641ded7acf26308976fc1216ffa1bb.zip cgeo-db2f78f8d4641ded7acf26308976fc1216ffa1bb.tar.gz cgeo-db2f78f8d4641ded7acf26308976fc1216ffa1bb.tar.bz2 |
Cache ETag and Last-Modified HTTP headers for images
Instead of comparing the "Last-Modified" dates and adding a round-trip to
the server, this now caches the "ETag" and "Last-Modified" headers if
they are present in the server HTTP response.
Those values are given back (using respectively "If-None-Match" and
"If-Modified-Since" request headers) to the server when requesting an
update. Most servers will answer with a "304" (use local copy) if the
requested resource has not been updated. In the unlikely case that the
server does not honor those headers, the image will be refreshed in any
case, so we will not serve old images to the user.
The rationale for storing the "Last-Modified" return value is to conform
to RFC 2616 advice to treat it as opaque because the server might do an
exact string comparison instead of an ordered date comparison.
Diffstat (limited to 'main/res')
0 files changed, 0 insertions, 0 deletions