protomaps / PMTiles

Cloud-optimized + compressed single-file tile archives for vector and raster maps
https://protomaps.com/docs/pmtiles/
BSD 3-Clause "New" or "Revised" License
1.92k stars 107 forks source link

Azure and Google Cloud CDN support #174

Open bdon opened 1 year ago

bdon commented 1 year ago

Determine the right set of services to use for each analogous to Cloudflare / AWS.

bdon commented 1 year ago

Findings

Azure

Google Cloud

More to come.

tengl commented 1 year ago

I uploaded the pmtiles file to the $web folder (static web site) in an Azure Blob Storage. Base on the logic for AWS and Cloudflare, I made a Function App that translates zxy urls to requests with a Range header using FetchSource. It is more generic than the other solutions since the pmtiles file can be published anywhere, but the entry point is of course specific to Azure Function Apps.

I don't know if accessing the pmtiles file directly using some other API would improve performance, but if you put it behind a CDN it will be fast as long as it hits the cache.

If you like I can make a PR with the code.

tengl commented 1 year ago

I created a pull request #197.

I found out that the pmtiles file doesn't have to be in the $web (static web site) folder, I only forgot to set access level on the container, that is why it didn't work for me.

bdon commented 1 year ago

Thanks, see comment https://github.com/protomaps/PMTiles/pull/197#issuecomment-1595486386 for next steps