[OSM-talk] osmarender4

David Earl david at frankieandshadow.com
Mon Feb 19 17:23:46 GMT 2007



> -----Original Message-----
> From: matthew-osm at newtoncomputing.co.uk
> [mailto:matthew-osm at newtoncomputing.co.uk]
> Sent: 19 February 2007 15:48
> To: David Earl
> Cc: OJW; talk at openstreetmap.org
> Subject: Re: [OSM-talk] osmarender4
>
>
> On Mon, Feb 19, 2007 at 12:25:45PM -0000, David Earl wrote:
> > I got this back:
> >   api_1.0|EXISTS|47574|bytes|mcn|1171813044|2007-02-18T15:37:24
> >
> > So presumably the tile was up to date (rendered only 3 hours
> before I sent
> > the message, in fact). The adjacent tile which is osmarender4
> was actually
> > rendered earlier:
> >
> >   api_1.0|EXISTS|61568|bytes|dodi|1171623386|2007-02-16T10:56:26
> >
> > So 'mcn' is running old tiles at home.
>
> Um... I was one of the first to update to osmarender4, I believe.
> I tend to "svn
> up" on a daily basis, give or take a day or so ;)


So, it turned out this was the browser caching the tiles. I should have
thought of that, sorry.

However, it's not satisfactory for the typical visitor to have to know that
they come back to an area they've visited before, they won't get the most
recent map if they don't empty the cache (most visitors won't know what a
cache is). Also, this presumably results in those pesky 'more osm coming
soon' tiles getting lodged in the cache.

May I suggest therefore

(a) The Javascript which requests the tiles constructs the url to be
something like
  http://dev.openstreetmap.org/~ojw/Tiles/tile.php/16/32799/21590.png?mark=2
00702191700
where the query string is constructed in the JS to be the date/time to some
level of granularity (say 15 minutes or an hour). In this way, scrolling
around will use the cache and keep the server load down, but repeat visits
more than the granularity later will get updated.

(b) the server sets the 'Cache-Control: No-cache' http header for the 'more
osm' tiles. (I'm assuming that the pngs aren't delivered from a directory
structure matching the URL's hierarchy, but that something like mod_rewrite
passes the parts to a script which is therefore in the position to make this
header in this special case).

David





More information about the talk mailing list