[Tilecache] PATCH: X-SendFile and Expires headers

mdeneen+tiles at saucontech.com mdeneen+tiles at saucontech.com
Mon Oct 5 17:24:25 EDT 2009


This patch adds X-SendFile and the ability to set an Expires header.  It is a patch against tilecache 2.10.

Once applied, you can specify two new options under [cache] in the tilecache.cfg:

sendfile=yes
    This instructs tilecache to not read the tile image and send the fully qualified file name back to the web server in a X-SendFile header.  This avoids both python and the web server from holding the tile in memory at the same time.  The web server serves the tile directly to the client.
expires=n
    ...where nnnn is the number of hours from access time you wish to have the tiles possibly cached in the client browser.

I've tested this with lighttpd and apache (with mod_xsendfile http://tn123.ath.cx/mod_xsendfile/), and it works perfectly.  I've not tried seeding the cache with this.  You might have to disable sendfile to do that.  I'll test tomorrow.

Best Regards,
Mark Deneen
Saucon Technologies
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sendfile_expires.diff
Type: text/x-patch
Size: 2578 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/tilecache/attachments/20091005/7c7c7173/sendfile_expires.bin


More information about the Tilecache mailing list