Forum Moderators: phranque
CacheRoot c:/cacheroot
CacheEnable disk /
CacheDirLevels 5
CacheDirLength 3
CacheMinFileSize 1000
CacheMaxFileSize 6400000
CacheIgnoreCacheControl On
CacheIgnoreNoLastMod On
CacheMaxExpire 604800
The manual says that in "CacheEnable" comes an url-string. I tried to put something like
"CacheEnable /cgi-bin/mapserv.exe*getMap*"
that would handle
http://www.example.com/cgi-bin/mapserv.exe?service=WMS&version=1.1.1&map=d:/Lebanon_Trial/mission_19.map&request=getMap&layers=Area2PreRoadsGC&bbox=35.214988,33.106340,35.220560,33.110730&srs=EPSG:4326&width=80&height=80
but that does not cache nothing. Is there some other possibility to cache urls with regular expressions or wildcards?
Thanks in advance,
karlos
[edited by: jdMorgan at 4:02 pm (utc) on Nov. 5, 2008]
[edit reason] example.com [/edit]
Not intending to complicate matters, but you may find that this will only work effectively if you change your URLs to a static-looking format, and then mod_rewrite those static URLs, when requested from your server, to the mapservere.exe filepath with the query string parameters moved from the static URL-path to the query string appended to the filepath. This would allow the URL-string to be simpler and cleaner, and allow CacheEnable to detect it more efficiently.
However, this also involves changing all of the mapserver links on all of your Web pages.
Example:
http://www.example.com.com/cgi-bin/mapserv.exe?service=WMS&version=1.1.1&map=d:/Lebanon_Trial/mission_19.map&request=getMap&layers=Area2PreRoadsGC&bbox=35.214988,33.106340,35.220560,33.110730&srs=EPSG:4326&width=80&height=80
might be linked-to on your pages as:
http://www.example.com/games/maps/Lebanon_Trial/mission_19/getMap/Area2PreRoadsGC/35.214988,33.106340,35.220560,33.110730/EPSG:4326/80x80
and mod_rewrite would then internally rewrite that back to the dynamic mapserver script calling format.
You could then use
CacheEnable /games/maps/
This problem, along with using mod_rewrite, emphasizes that URL-paths and filepaths are two entirely different things; They are two different content-location systems which are "associated" but not equivalent. URLs are used on the Web, and filepaths are used inside the server. A server's most fundamental job is to translate URLs to filepaths, so that Web clients need have no knowledge of the server or its operating system and filesystem organization to retrieve content.
As I said, I have not used mapserver, so you would probably do well to seek out some true experts on mapserver itself -- and especially those familiar with caching issues. Hopefully, the above ideas may still be helpful.
Jim