Map Tiles Caching

If I’m using a map server, will Cloudflare cache map tiles, so they don’t always need to be re-requested from the map server itself? (This would be a good thing.) I think the tiles are in .png format, which is one of the file types that Cloudflare does automatically cache. But the process between Leaflet and the request is a little unclear to me. I think that if Leaflet is requesting files by name, caching should be automatic. But if the map server sends files back with names that are dynamic, then that would not be so straightforward. So basically, I’m looking for an answer from someone who has experience with this either working, or not working.

If the ‘map server’ is on another domain, there’s no way for Cloudflare to serve those files from the CF cache since it’s not in control of that map server’s domain. They would have to sign up for CF themselves.

So if we ran our own map server, from our domain, caching would then be possible?

So if we ran our own map server, from our domain, caching would then be possible?

Yes. As long as the domain is served through Cloudflare.

Optionally, you could setup a “worker” in Cloudflare to pull and cache requests from the map server, but that is tedious and would cost for the worker service.

This topic was automatically closed after 30 days. New replies are no longer allowed.