Closed georgbachmann closed 3 years ago
You could set it in tileserver-gl but it would involve modifying the code and maintaining a fork; the varnish cache config would probably be an easier place to set it.
Yep... we solved our problem using the varnish cache headers! Thanks for your answer though! Cheers
hi @georgbachmann could you please share your varnish config i'm stuck with it right now in my docker config? Tx
@2803media we ended up using ATS (appache traffic server) for our caching, as we could not invalidate individual tiles using varnish (unlong we pay a looooooot per year) If it's still relevant to you with ATS, i could ask the person who did it how... I don't know much about that kind of black-magic :)
I should probably have asked more about the use case, whether you're trying to get varnish to cache tiles for a certain amount of time, or browsers, or both. If you're trying to send headers to the browser to instruct it to cache for one day, you could use something like:
sub vcl_deliver {
set resp.http.Cache-Control = "public, max-age=86400";
}
If you're trying to cause varnish to hold the tiles in its cache for one day, you might use something like:
sub vcl_backend_response {
set beresp.ttl = 24h;
}
@2803media we ended up using ATS (appache traffic server) for our caching, as we could not invalidate individual tiles using varnish (unlong we pay a looooooot per year) If it's still relevant to you with ATS, i could ask the person who did it how... I don't know much about that kind of black-magic :)
Thanks for your reply and you are happy with the performance with ATS (which I never try ;)), if you have more information on the setup I will be happy to try it!
Just a very simple quick question...
We just noticed that tileserver-gl responses do not include a Cache-Control header. Is it possible to add some using tileserver-gl or should we do so in our varnish cache?