I have a functioning mapserver installation runing on Ubuntu 14.04 and it's working fine. However, I would like to up the performance by putting mapcache in front of it.

I've installed mapcache, but I can't seem to create a valid mapcache.xml file.

I've found a number of 'complete' examples online, but I'm having trouble wrapping my head around all of the details.

Can someone point me to a minimal mapcache.xml file that simply forwards GetMap requests to mapserver and caches the resulting tiles?

That would at least help get me started.

  • I second this post, I've been also looking for a simple example to do this, I want to use CGI directly.
    – Gery
    May 30, 2015 at 23:18
  • And not through WMS? Does WMS already work for you with the mapcache.xml that comes with the sources?
    – user30184
    Jun 1, 2015 at 10:58
  • well, I think it could be through WMS, the problem if I'm right is that through WMS I would have to add all the details of my WMS layers in the mapcache.xml, and using CGI would be simpler (ie. mapcache fetches all layers details directly from the main MAP file), am I right? does it work that way?
    – Gery
    Jun 1, 2015 at 20:27
  • So where do you stand now? Have you had a try with the demo configuration that installs by default and is also available from github.com/mapserver/mapcache/blob/master/mapcache.xml?
    – user30184
    Jun 3, 2015 at 8:57
  • 1
    The direct use of mapfile is still undocumented as in lists.osgeo.org/pipermail/mapserver-users/2013-September/… and I think it is an experimental feature and need to be activated when building mapcache. Have you made your own build from the sources and with the USE_MAPSERVER flag? Otherwise I fear that you are wasting your time.
    – user30184
    Jun 3, 2015 at 9:08

1 Answer 1


If you want to cache tiles from the backend WMS without having to know the layer names beforehand use either "combined_mirror" or "split_mirror" mode.

This doesn't seem to be properly documented, but it is mentioned in this issue

"combined_mirror" makes a tileset for each combination of layers encountered. "split_mirror" will make a tileset for each layer and then assemble these tiles.

The configuration shown in the issue (note "combined_mirror" and no wms layers defined):

<?xml version="1.0" encoding="UTF-8"?>

<mapcache mode="combined_mirror">
   <cache name="disk" type="disk">

   <source name="vmap0" type="wms">


   <tileset name="mirror">
      <metatile>5 5</metatile>


   <service type="wms" enabled="true">
      <forwarding_rule name="catch all">
   <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"/>



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.