<div dir="ltr"><div>Is it possible to utilize mapcache regex dimensions with mapserver run time substitution (wms) to create a more dynamic and generic tile service <br></div><div><br></div><div>Here is my basic configuration for mapserver and mapcache, I can't seem to get it working with QGIS when connecting to the WMTS<br></div><div><br></div><div>For example I use run time substitution with my PG DATA settings</div><div><br></div><div>  LAYER<br>    NAME "sub_layer"<br>    .......<br>    VALIDATION<br>      'layer_table' ^.*$'<br>      'layer_class' '^.*$'<br>    END<br>    CONNECTIONTYPE postgis<br>    CONNECTION "port=9999 user=user password=pw dbname=db host=mydb"<br>    DATA "the_geom from (SELECT gid, ms_color, the_geom FROM %layer_table% WHERE class='%layer_class%') AS foo USING UNIQUE gid using SRID=4326"</div><div>     ....</div><div>  END<br></div><div></div><div></div><div><br></div><div>I set my MapCache config up with the same runtime variables as dimensions</div><div><br></div><div>   <source name="source_wms" type="wms"><br>      <getmap><br>         <params><br>            <FORMAT>image/png</FORMAT><br>            <TRANSPARENT>true</TRANSPARENT><br>            <LAYERS>sub_layer</LAYERS><br>         </params><br>      </getmap><br>      <http><br>         <url><a href="http://testserver.com/cgi-bin/wms">http://testserver.com/cgi-bin/wms</a>?</url><br>      </http><br>   </source><br>   <tileset name="tileset_regex"><br>      <source>source_wms</source><br>      <cache>composite</cache><br>      <grid>GoogleMapsCompatible</grid><br>      <format>PNG</format><br>      <metatile>5 5</metatile><br>      <metabuffer>10</metabuffer><br>      <expires>3600</expires><br>      <auto_expire>604800</auto_expire><br>      <dimensions><br>        <dimension type="regex" name="layer_class" default="none"><br>          <regex>^.*$</regex><br>        </dimension><br>        <dimension type="regex" name="layer_table" default="none"><br>          <regex>^.*$</regex><br>        </dimension><br>      </dimensions><br>   </tileset><br></div><br></div>