[mapserver-users] mapcache config confusion

Schweitzer, Peter pschweitzer at usgs.gov
Fri Aug 30 14:50:31 PDT 2013


Help!

I am trying to use mapcache, but I fear that I may have misunderstood
the documentation.  Can someone help correct my misimpressions?

I'm running a mapserver (6.2.0) instance with 113 WMS services.  Most
don't really need caching because the data are simple or small.  One
really does, because it is a geologic map of the continental US at
1:500k scale, with 320,000 polygons and 260,000 fault lines, and takes
some time to render as map images.

I have a complicating factor.  I'm using a simplified URL to access
the map services, with an Apache rewrite rule like that rewrites the
incoming URL http://mrdata.usgs.gov/services/sgmc-3857 to
http://mrdata.usgs.gov/cgi-bin/mapserv?map=/mnt/mrt/map-files/sgmc-3857.map&...
 This works nicely for OpenLayers.

What I'd like to have happen is for the web server to provide cached
images of these data rather than generating them on every web hit.

So first of all, is mapcache the right tool for this task?

Assuming that's right, I'm confused about the <url> element in the
<source> section.  Should this be the existing WMS on my system?
Should it be the URL sent by the user, prior to the apache rewrite
rule?  Or should it be the URL that is the result of the rewrite rule?

An OpenLayers interface that uses these data is at
http://mrdata.usgs.gov/general/map.html  The layer in question is the
"Geology" layer.

I do not get any cached images.  I recognize that the problem may be
somewhere else in this process, but here is my mapcache.xml file,
cribbed and modified from an older list message by Stephen Woodbridge:

<?xml version="1.0" encoding="UTF-8"?>
<mapcache>
   <metadata>
     <title>MRData mapcache service</title>
     <abstract>Contains various services for MRData maps</abstract>
   </metadata>

   <cache name="disk" type="disk">
     <base>/mnt/mrt/mapcache</base>
     <symlink_blank/>
   </cache>

   <source name="sgmc" type="wms">
     <getmap>
       <params>
         <FORMAT>image/png</FORMAT>
         <MAP_IMAGETYPE>png</MAP_IMAGETYPE>
         <LAYERS>Lithology,Faults,Dikes</LAYERS>
         <MAP>/mnt/mrt/map-files/sgmc-3857.map</MAP>
       </params>
     </getmap>

     <http>
       <url>http://mrdata.usgs.gov/services/sgmc-3857</url>
     </http>
   </source>

   <format name="PNGQ_FAST" type="PNG">
     <compression>fast</compression>
     <colors>256</colors>
   </format>

   <tileset name="sgmc">
     <source>sgmc</source>
     <cache>disk</cache>
     <grid>WGS84</grid>
     <grid>g</grid>
     <grid>GoogleMapsCompatible</grid>
     <format>PNGQ_FAST</format>
     <metatile>5 5</metatile>
     <expires>864000</expires>
   </tileset>

   <default_format>PNGQ_FAST</default_format>

   <service type="wms" enabled="true">
     <full_wms>assemble</full_wms>
     <resample_mode>bilinear</resample_mode>
     <format>PNGQ_FAST</format>
     <maxsize>4096</maxsize>
   </service>
   <service type="wmts"  enabled="true"/>
   <service type="tms"   enabled="true"/>
   <service type="kml"   enabled="true"/>
   <service type="gmaps" enabled="true"/>
   <service type="ve"    enabled="true"/>
   <service type="demo"  enabled="true"/>

   <errors>report</errors>
   <lock_dir>/tmp</lock_dir>
</mapcache>

I am also not seeing error messages in either the apache log or the
mapserver log.  Here is my apache config:

LoadModule mapcache_module    modules/mod_mapcache.so

<IfModule mapcache_module>
    <Directory /mnt/mrt/mapcache>
       Order Allow,Deny
       Allow from all
    </Directory>
    MapCacheAlias /mapcache "/mnt/mrt/mapcache/mapcache.xml"
</IfModule>

Thanks in advance for any help you might provide.

Peter
-- 
Peter N. Schweitzer (U.S. Geological Survey, Reston, VA 20192)
(703) 648-6533  email: pschweitzer at usgs.gov
http://geology.usgs.gov/peter/


More information about the mapserver-users mailing list