-
I see a marked difference when I load the same pmtiles file stored in Cloudflare r2 storage when I load it through a Cloudflare worker and when I load it directly using the ol-pmtiles JS library. The load times are much less (faster) for the Cloudflare worker. Is this common and if yes, what is the technical reason? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes - it is almost certainly faster, because the round-trips to fetch the header and directories happen between the worker in a Cloudflare datacenter and R2, which goes over Cloudflare's network. Loading it directly means those round-trips are between your physical location and r2. It will also depend on your physical location relative to the r2 bucket. If you did not provide a location when creating the bucket it should have defaulted to the closest one to you: APAC, Eastern Europe, Western Europe, Eastern NA, Western NA. |
Beta Was this translation helpful? Give feedback.
Yes - it is almost certainly faster, because the round-trips to fetch the header and directories happen between the worker in a Cloudflare datacenter and R2, which goes over Cloudflare's network. Loading it directly means those round-trips are between your physical location and r2.
It will also depend on your physical location relative to the r2 bucket. If you did not provide a location when creating the bucket it should have defaulted to the closest one to you: APAC, Eastern Europe, Western Europe, Eastern NA, Western NA.