Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Use cached tiles while doing a if-none-modified request #896

Closed
kkaefer opened this issue Feb 17, 2015 · 3 comments
Closed

Use cached tiles while doing a if-none-modified request #896

kkaefer opened this issue Feb 17, 2015 · 3 comments
Assignees
Labels
performance Speed, stability, CPU usage, memory usage, or power usage

Comments

@kkaefer
Copy link
Contributor

kkaefer commented Feb 17, 2015

We should show cached, but expired tiles immediately, do a If-None-Modified request meanwhile and update tile if changed. While this technically violates the HTTP spec, it will also ensure that the user sees a map as soon as possible. In most cases, the map is either fresh, or the visible differences are negligible.

@aruediger
Copy link

It's either If-None-Match (ETag based) or If-Modified-Since (time based). Just sayin.

@kkaefer
Copy link
Contributor Author

kkaefer commented Sep 15, 2015

@2Beaucoup you're right, and the code uses the correct header names:

if (!existingResponse->etag.empty()) {
const std::string header = std::string("If-None-Match: ") + existingResponse->etag;
headers = curl_slist_append(headers, header.c_str());
} else if (existingResponse->modified) {
const std::string time =
std::string("If-Modified-Since: ") + util::rfc1123(existingResponse->modified);
headers = curl_slist_append(headers, time.c_str());
}

@kkaefer
Copy link
Contributor Author

kkaefer commented Oct 22, 2015

This is implemented as part of #2617.

@kkaefer kkaefer closed this as completed Oct 22, 2015
@incanus incanus added the P0 label Nov 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

No branches or pull requests

5 participants