[openstreetmap/openstreetmap-website] Update embed.js.erb to use CDN test URLs (#2714)
Ian Dees
notifications at github.com
Fri Jul 31 21:33:03 UTC 2020
> How long will fastly keep cached tiles around before they expire, and new tiles will be fetched from other caches or the rendering server?
Fastly [respects the Cache-Control headers](https://docs.fastly.com/en/guides/configuring-caching) that the backend sends. For example [this tile](https://tile-openstreetmap-org.global.ssl.fastly.net/5/6/0.png) specifies `Cache-Control: max-age=111272` (plus some other bits), so Fastly will cache it up to 111,272 seconds (~1d6h). That header came from the backend, so we can control that behavior. It's the same header that Squid pays attention to, so I'm sure it has been tweaked already.
We can control the Fastly cache TTL separately from the browser TTL using the shared max-age part of the Cache-Control header.
More info on MDN's [`Cache-Control` page](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).
> What are options to selectively purge cache contents on fastly in case of vandalism?
Fastly has a [cache purge API](https://developer.fastly.com/reference/api/purging/) that we can use through the web interface or via an API once the backend is ready to re-render a corrected tile.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2714#issuecomment-667379060
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200731/6083695e/attachment.htm>
More information about the rails-dev
mailing list