IE doesn't like 'mixed content', i.e. both https and https. A badly worded warning is pushed into the face of the user. Now Chrome is beginning to give warnings, too. So if you have an aplication that is secured with https, and get tiles directly from OSM (that only serves via http), the user will be distracted by bogous warnings. Solution: cook your own forwarding proxy that serves tiles via https. (The old trick to just return a redirect (301, 'Moved Permanently') to the real osm URL no longer works so well, and is btw slow). For extra flavour, add caching. It's easy; it only takes 10-20 lines of Java servlet code. This both increases map load speed and reduces load on the osm server. :-) just keep the tiles in files, and re-read if file.lastModfied is older than y hours. Now, here's the question. How long should such a forward proxy cache a tile? One hour? One day? Some other value? asked 14 Nov '11, 09:31 tmpsa Jonathan Ben... |
The Tile Usage Policy states that you should
Every tile is served with a bunch of HTTP headers, some of which let the client know how long they should cache the tiles for. You don't normally have access to the HTTP headers, but you can find them out using various tools, such as
The Expires header says that you would cache this tile until the date and time shown. The tile server uses a variety of mechanisms to estimate the length of time each tile should be cached, including how recently it was redrawn, what zoom level its on and so on. Most caching proxies will, by default, read and use the dates shown in the Expiry header, and you probably won't have to do any configuration. If your caching proxy for some reason can't read the Expiry header, you should configure it to cache everything for 7 days instead. answered 14 Nov '11, 21:45 Andy Allan |
From the Tile Usage Policy. answered 14 Nov '11, 10:28 Richard ♦ 1
I can't parse that statement. It's, um, a bit terse. What, exactly, does it mean?
(14 Nov '11, 10:57)
tmpsa
1
If you don't know what an HTTP Expiry header is, cache for seven days.
(14 Nov '11, 17:22)
Jonathan Ben...
|