[ka-Map-dev] [PATCH] Tiles caching bugfix

Luper Rouch luper.rouch at gmail.com
Thu May 10 17:33:46 EDT 2007


I had issues with tiles being excessively cached by my browser : I'm
writing a simple web based MapServer editor, and I had to reload the
ka-map frame to see the newly generated tiles after every change.

Examining the headers sent by apache for static files it appeared that
Cache-Control and Expires were never sent, only Etag. So I tried to
replace these headers with a single Last-Modified in tile.php and
obtained the desired behavior : the tiles are fetched from the browser's
cache until their modification time actually changes in the ka-map cache.

Note that adding the Last-Modified header was not sufficient, Expires
and Cache-Control made the browser ignore it and had to be removed. I'm
not sure if this is a browser bug or the normal behavior defined by the
standard (tested with firefox 2.0.3).

The attached patch has been made on the current CVS head.

Luper Rouch

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tiles-headers.patch
Type: text/x-patch
Size: 430 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/ka-map-dev/attachments/20070510/6532e06b/tiles-headers.bin

More information about the ka-Map-dev mailing list