[mapserver-users] Getting Browsers to cache mapserv URLs

Cameron Shorter cameron at socialchange.net.au
Sat May 5 07:10:04 EDT 2001


mapserver-users,

We would like to improve the speed of our applications by enabling the
caching of mapserv maps.
The idea is that you design your mapping application to encourage uses
to use default map extents so that they can reuse map images from local
cache.

However, for caching to work, the mapserv cgi script needs to:
1. Return a "Last-Modified:" field in header.
2. Read the cgi request parameters, recognise the
$HTTP_IF_MODIFIED_SINCE parameter, and return "Status: 304 Not
Modified\n\n" if the map has not changed since the last query.

(There are a few other network issues, but they can be addressed
seperately.)

I'm interested to know:
1. Would others find this feature useful?
2. How best to implement this?
3. How should we work out the date for the "Last-Modified:" timestamp?
* The quick and dirty option would be to use the timestamp of the .map
file.
* A better solution would be to check the time stamps of all the layers
and .map file, and take the latest.
4. Should caching be rolled into all versions, or be an option at
compile time?
5. Does anyone have any experience with caching, or example C code that
we could use?

References
==========
Short description of writing cache pages for CGI scripts
http://vancouver-webpages.com/CacheNow/detail.html#CGI

An example perl program which uses caching
http://vancouver-webpages.com/proxy/log-tail.pl

General Article on caching
http://www.mnot.net/cache_docs/
In particular, how caching applies to CGI scripts
http://www.mnot.net/cache_docs/#SCRIPT


-- 
Cameron Shorter          Web Mapping Manager
Social Change Online
248 Johnson St           Tel: +61 (0) 2 9692 5115
Annandale NSW 2038       Fax: +61 (0) 2 9692 5192
Sydney, Australia        http://webmap.socialchange.net.au



More information about the mapserver-users mailing list