[ka-Map-dev] RE: [ka-Map-users] precache

Tim Schaub tim at commenspace.org
Mon Apr 24 11:43:55 EDT 2006

I've updated precache2.php to address an issue I had overlooked.

> 2) launched precache2.php
> cache dir is 2.8 MB (1419 objects)
> 4) I open ka-Map application as it is. Immages are charged:
> cache dir 3.1 MB (1701 objects)

If you're using max_extents, both pre-caching and panning/zooming will
always generate more tiles than are displayed in the viewport.  The
precache2.php script generates an integer number of metatiles, ensuring
that the tiles overlap your max_extents.  While you're panning/zooming,
tile requests are triggered in a buffer around your viewport.
Generally, panning/zooming causes more excess tiles to be generated than

Though these excess tiles are never visible in your viewport (with
max_extents), they are requested by kaMap.js.  There is still a problem
with precache2.php in that it is still too conservative in generating
tiles - non existent tiles (though never visible in the viewport) are
requested endlessly as they produce errors loading.  This is a problem
if you are pre-caching tiles and using "tile_source" "cache."

The solution to this is to modify precache2.php to produce a bigger
buffer around the viewport or to modify kaMap.js so that it doesn't
request tiles outside the maximum extent.  I'm guessing that the vote
would be to render more tiles rather than burden kaMap.js with another
conditional check.


More information about the ka-Map-dev mailing list