Hacker News new | ask | show | jobs
by curiousfab 1298 days ago
As a solution in between, for those who want to include a OSM map on their website but don't want to put load on the official OSM tile servers, a simple tile proxy may be a good idea.

I am using something based on https://wiki.openstreetmap.org/wiki/ProxySimplePHP5 for a long time already and since I don't need to have up to date tiles every day, I set the TTL to a few weeks.

Together with leaflet this works beautifully.

2 comments

Out of curiosity, what’s the motivation to error suppress the mkdir call here (my PHP is rusty)? Anyway, this is great. Thank you for sharing!
It returns an error if the directory already exists (same as in Python)
While we're on the topic, in Python there's a nice way to deal with this:

os.makedirs(path, exist_ok=True)

For sure! There's a lot of in-between solutions (depending on what services/regions/update frequency you need).