protomaps / go-pmtiles

Single-file executable tool for working with PMTiles archives
BSD 3-Clause "New" or "Revised" License
350 stars 48 forks source link

Handle when etag changes on remote archive #130

Closed msbarry closed 6 months ago

msbarry commented 6 months ago

Change pmtiles serve to keep track of etag from the initial root request on remote archives (HTTP or S3) and make all subsequent requests to that archive with If-Match: ${root_etag}. If any of those requests fail with a 412 or 416 http status code (the remote archive changed) then purge all entries from the cache with that etag and refetch the root and any directories needed for that request at most once.

Followups not included in this PR:

Fixes #17