[Tilecache] Max-Age

Attila Csipa plists at prometheus.org.yu
Wed Nov 12 20:45:28 EST 2008


On Wednesday 12 November 2008 15:03:25 you wrote:
> On Wed, Nov 12, 2008 at 08:59:38AM -0500, Alexandre Dube wrote:
> >  I don't know ( didn't see the patch, btw I'd like to see it, please ).
> > Mine would be as simple as : add a new variable to the constructor and
> > parse its value ( like I already did, but instead of hardcoding the
> > value "86400", users could enter it in the .cfg file)
>
> This level fo support desn't need a patch to TileCache. Just use
> mod_expires in Apache.

Agreed, my patch was a bit more complex, it generated last-modified and etag 
headers. Note that this is not exactly the same as what you would be doing 
with mod_expires. With mod_expires the browser will reuse the tiles if within 
the specified time period without contacting the server at all (which makes 
it extremely quick). With ETag, browser requests *do* exist but no tiles get 
transferred unless they have been changed since the last retrieval. This 
allows map refreshing without any delays or manual cache purges (good for 
development work and maps that get changed on a sub-daily basis - f.e. meteo 
stuff). 

Another nusproduct of ETags is that the requests are shown in your logs, so 
you can still see/track user activity (I use this to regenerate the most 
requested tiles in higher quality on the next seeding pass). With expires, 
you can't tell the difference (at least not as easily) if somebody just 
panned through an area or was returning and/or zooming in and out repeatedly.

I just checked the patch with a current checkout of tilecache and for some 
reason it still reloads the tiles occasionally when it, in fact, shouldn't, 
so I'll have to investigate a bit what's causing that and then I'll resubmit 
it to Chris.



More information about the Tilecache mailing list