[Tilecache] http 304 Not Modifies responses ?

Christopher Schmidt crschmidt at metacarta.com
Wed Jan 2 09:01:45 EST 2008


On Wed, Jan 02, 2008 at 02:00:59PM +0100, Attila Csipa wrote:
> I've been looking at ways of improving the speed of the web mapping projects 
> I'm in and that's how I ran accross TileCache. While it works pretty smoothly 
> after a quick glance at the source it occured to me that it does not support 
> any client side caching (with the help of f.e. 304 Not Modified responses). 

In general, I simply use mod_expires on the Apache side to do this for
me: I set the expiration time to 1 month, and it stays in cache for as
long as neccesary.   

> I made a patch that does the job (inserts Last-Modified and ETag
> headers based on the date and content of the generated tile and
> responds with a 304 if the header comes back for a reload of a tile it
> already has), 

I'm interested as to how you're doing this :) I've sat down to implement
it a couple times, and never been happy with it -- since it wasn't
designed in from the beginning, tile metainformation isn't really
returned from the cache, and I couldn't figure out how to make it so
without breaking things.

> but I'm not sure how the general public feels about this or if it's
> worth putting back in the trunk. 

I definitely think that it is worth putting it back into trunk so long
as it isn't completely cockneyed -- I'd love to get a look at it
regardless. 

> Some clients (like openlayers) for some reason do not provide the
> If-Newer-Than headers with their requests so that would need a bit of
> investigation, 

If-Newer-Than doesn't sound like the right header from memory: I believe
"If-Modified-Since" is the one that should get sent in that case. Since
OpenLayers just makes <img> tags, this is a bug in Firefox, if anywhere,
but I think that we'll likely find it's just something minor that's
being missed somewhere which we can pick up. Regardless of what
OpenLayers or browsers do, this still has value and I'd still like to
see it.

> bit first I'd like to hear what people here think about this sort of
> approach (or a pointer where maybe this has been discussed previously)

not on-list as far as I'm aware: people are usually happy just adding
mod_expires, but doing smarter tile cache expiration is certainly a
good idea.

> or whom I should talk to about submitting patches. 

Send 'em to the mailing list. I'll look at it when I get a chance.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Tilecache mailing list