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
2.02k stars 118 forks source link

Firefox / Safari compatibility ? #69

Closed AnthonyHervy closed 2 years ago

AnthonyHervy commented 2 years ago

Hi,

thank you for amazing work with pmtiles, hope this project will continue to develop, in terms of performance for vector tiles it's really very practical.

On demo website https://protomaps.github.io/PMTiles : no problem on protomaps with chrome navigator.

When I try with other navigator (Firefox and/or Safari), OPTIONS is added in header : resp status code is 206, header seems right but error when loading ressources.

Does we use other method to request if user use firefox or safari ?

GET /64/64102/64102.pmtiles
Range: bytes=0-511999
Origin: https://protomaps.github.io
Referer: https://protomaps.github.io/
Accept: */*
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15
Accept-Encoding: identity
206 Partial Content
Access-Control-Allow-Methods: GET, HEAD
Access-Control-Allow-Origin: *
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=XyK7u5vFH9gTJN7LwTSqd0KfwAsoesZiv2989kAyLWn784XnqY%2BYv0Nts8APbDrnLvtk4JgER3aqrWqegSrfBSJRs2qkgZ%2BSloqgrxi539D2nJZjkIYFtww%2FZ0owq7ZcpfPJ2S6jMPaPGRTmrJhZZVT4DXo%3D"}],"group":"cf-nel","max_age":604800}
Via: 1.1 182e7ab2ee669d6d9e48c29c3622b7dc.cloudfront.net (CloudFront)
Vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method
Date: Mon, 29 Aug 2022 13:46:37 GMT
Access-Control-Expose-Headers: ETag
Content-Type: application/x-protobuf
ETag: W/"61cb7963e3dbf69df85f73538d762df0-3"
Last-Modified: Mon, 22 Aug 2022 07:01:39 GMT
Content-Range: bytes 0-511999/22931723
cf-ray: 7425bbe0ddf8d200-CDG
Server: cloudflare
Alt-Svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
x-amz-cf-id: oBnffIH8q746fFyqmvuG1Ob9L3QZYXxNrNcbNfKSFhw6BhVgcHxoSw==
x-amz-cf-pop: CDG50-P1
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
x-cache: Miss from cloudfront
cf-cache-status: DYNAMIC

If you want to check, file with open data is available here : https://tilesets.urbanease.io/cadastre/64/64102/64102.pmtiles

Capture d’écran 2022-08-29 à 16 18 56
AnthonyHervy commented 2 years ago

edit : without gzip compression on aws s3 is ok :)

bdon commented 2 years ago

@AnthonyHervy were you attempting to open https://tilesets.urbanease.io/cadastre/64/64102/64102.pmtiles in the inspector page? If so you may have been missing CORS headers for https://protomaps.github.io which would result in the red error message in browser console. That doesn't explain why it would work in Chrome though, mysterious...