PMTiles icon indicating copy to clipboard operation
PMTiles copied to clipboard

Azure and Google Cloud CDN support

Open bdon opened this issue 2 years ago • 4 comments

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

bdon avatar May 08 '23 06:05 bdon

Findings

Azure

  • Azure Front Door seems to be the preferred CDN deployment, but has a $35 min monthly fee
  • Azure Functions supports NodeJS, meaning it should be able to share code with CF/AWS; getting it to communicate and authenticate with Storage Buckets is tricky

Google Cloud

  • Cloud CDN cannot communicate directly with Cloud Run or Cloud Functions without a Load Balancer?
  • Cloud CDN cannot do dynamic CORS?

More to come.

bdon avatar May 08 '23 14:05 bdon

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 avatar Jun 15 '23 13:06 tengl

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.

tengl avatar Jun 16 '23 11:06 tengl

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

bdon avatar Jun 16 '23 23:06 bdon

Google Cloud: https://docs.protomaps.com/deploy/google-cloud Azure PR: https://github.com/protomaps/docs/pull/52

Both use the Dockerized go-pmtiles so don't have much platform-specific code.

bdon avatar Sep 02 '24 07:09 bdon