Open keithamoss opened 12 years ago
I imagine that you are trying to build a set of caches without knowing the layer names in advance right ? As for the expiry handling, please open another ticket.
Yup, that's correct.
I've opened https://github.com/mapserver/mapcache/issues/36 for the expiry handling side of things.
Let us know if you'd like anything more by way of explanation or detail of how we see this working.
mapcache already has a built in "mirroring mode" when configured with a single wms source. It will cache all LAYERS combination on getmap requests that corresponds to a configured <grid>
, and will forward the rest to the original wms server.
<?xml version="1.0" encoding="UTF-8"?>
<mapcache mode="combined_mirror">
<cache name="disk" type="disk">
<base>/tmp</base>
<symlink_blank/>
</cache>
<source name="vmap0" type="wms">
<getmap>
<params>
<FORMAT>image/jpeg</FORMAT>
</params>
</getmap>
<http>
<url>http://www2.dmsolutions.ca/cgi-bin/mswms_gmap</url>
</http>
</source>
<tileset name="mirror">
<source>vmap0</source>
<cache>disk</cache>
<grid>WGS84</grid>
<grid>g</grid>
<format>JPEG</format>
<metatile>5 5</metatile>
<metabuffer>10</metabuffer>
<expires>3600</expires>
</tileset>
<default_format>JPEG</default_format>
<service type="wms" enabled="true">
<full_wms>assemble</full_wms>
<resample_mode>bilinear</resample_mode>
<format>JPEG</format>
<maxsize>4096</maxsize>
<forwarding_rule name="catch all">
<http>
<url>http://www2.dmsolutions.ca/cgi-bin/mswms_gmap</url>
</http>
</forwarding_rule>
</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>
The important part is mode="combined_mirror"
which can also take the value split_mirror
:
Thanks Thomas, I didn't know this feature existed. It's pretty much exactly what we're after - though the ability to mirror more than one WMS source would be great.
Hi,
I am using above mapcache.xml, but when I make a request, I get an unsupported format error in the apache log file:
Request:
Error:
[Wed Feb 10 12:24:50.149724 2016] [:error] [pid 15:tid 140199099021056] [client 10.31.42.169:59779] wms request for tileset wind_area returned an unsupported format:\n\n
When I do a request for GetCapabilities, this seems to work OK and it doesn't complain about the CGI variable 'map' is not set: http://10.31.42.202:8008/mapcache/?map=/var/www/mapserver/maps/mymapfile.map&service=wms&request=GetCapabilities
Any idea why the getMap request fails with this error?
Regards, Manfred
The definition of MAP must be part of the source->getmap->params for the mapserver to query, not part of the mapcache request. This question is not related to the issue, please create an own instead.
The mapcache mirror modes are still not part of the documentation.
I'm going to throw this out here and see what people think of the idea.
If MapCache forwards a request to a WMS service for a single tile (256x256 / 272x272) of a layer it would be great to be able to specify that that layer be stored in a cache. I'm envisioning something like this:
I see the grid as either being specified manually, as here, or there being some smarts behind it by examining the SRS provided and working out the grid to use from there.
For expiry it would be great if mapcache could examine the Cache-Control or Expires headers and use that to determine when it needs to bypass the cache and request a new copy.
Thoughts and revisions more than welcome.