Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tileserver caching - not using browser cache #170

Open
theconor opened this issue Apr 29, 2021 · 0 comments
Open

Tileserver caching - not using browser cache #170

theconor opened this issue Apr 29, 2021 · 0 comments

Comments

@theconor
Copy link

Hi,

I'm not sure the tilesever caching is set-up correctly? It is not using the browser cache as I would expect.

For instance, look at the following request:
image

Request:

Request URL: https://stamen-tiles-b.a.ssl.fastly.net/toner-background/6/29/20.png
Request Method: GET
Status Code: 304 Not Modified
Remote Address: 199.232.192.249:443
Referrer Policy: strict-origin-when-cross-origin

Response:

Age: 2445187
Cache-Control: public,max-age=86400
Connection: keep-alive
Date: Thu, 29 Apr 2021 18:04:38 GMT
ETag: "c2d38533df96c1cfa40eb765d9e6e585"
Via: 1.1 varnish
X-Cache: HIT
X-Cache-Hits: 1
X-Served-By: cache-lhr7324-LHR
X-Timer: S1619719478.347455,VS0,VE1

For repeated requests of the same tile, the browser always requests from the Fastly CDN server, and it always gets the 304 Not Modified response.

It would be quicker if the browser could instead use the local cache and not need to make the request at all. The reason I think it does not do this is because the document "Age" is much greater than the cache-control "max-age". Presumably there would be a method using Fastly config to stop this form happening? When I previously used a different map service, the tiles were always cached locally.

If this problem can be fixed, it would hopefully make the service faster for end users and reduce the hit rate on the your CDN.

Apart from this, your map design and tile service are both excellent. Thanks for very much providing this extremely generous service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants