<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I have MapServer set up, rendering PostGIS into tiles for a Leaflet.js project. I want to cache a couple of the layers. I think I have something misconfigured in mapcache.xml. Mapcache is passing MapServer a BBOX instead of a tile reference.<div class=""><br class=""></div><div class="">Here’s the raw MapServer request, generated by Leaflet.js if I configure Leaflet to hit MapServer directly. This works fine.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; font-family: 'Source Code Pro';" class="">GET /cgi-bin/mapserv?map=/data/web/www/mapserver/sitesTest.map&layers=property_pt%20property_poly&mode=tile&tilemode=gmap&tile=131+190+9</div><div class=""><br class=""></div><div class="">Here’s a sample request if I configure Leaflet to hit Mapcache. This is what Leaflet asks my server for:</div></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; font-family: 'Source Code Pro';" class="">GET /mapcache/tms/1.0.0/hpsites/4/2/4.png</div></div><div style="margin: 0px; font-size: 16px; font-family: 'Source Code Pro';" class=""><br class=""></div><div style="margin: 0px;" class=""><div style="margin: 0px;" class=""><span style="font-family: Helvetica; font-size: 14px;" class="">That request generates the following internal </span>request, from Mapcache to Mapserver. It’s pretty close; the layers are right, but not the SERVICE, BBOX, WIDTH, and HEIGHT parameters.</div><div style="margin: 0px;" class=""><br class=""></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class="">GET /cgi-bin/mapserv?mode=tile&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-20135347.738994,-7611905.024751,-7416226.232341,5107216.481902&WIDTH=1300&HEIGHT=1300&FORMAT=image/png&SRS=EPSG:3857&MAP=/data/web/www/mapserver/sites.map&LAYERS=property_pt%20property_poly</div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""><br class=""></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""><span style="font-family: Helvetica; font-size: 14px;" class="">Mapcache.xml:</span></div><div style="margin: 0px;" class=""><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""><mapcache></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <cache name="disk" type="disk"></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <base>/var/www/mapcache/cache</base></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <symlink_blank/></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> </cache></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px; min-height: 20px;" class=""><br class=""></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <source name="hpsites" type="tms"></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <getmap></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <params></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <FORMAT>image/png</FORMAT></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span> <MAP>/data/web/www/mapserver/sites.map</MAP></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <LAYERS>property_pt%20property_poly</LAYERS></div><p style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px; min-height: 20px;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span> <br class="webkit-block-placeholder"></p><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> </params></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> </getmap></div><p style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px; min-height: 20px;" class=""> <br class="webkit-block-placeholder"></p><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <http></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <url><a href="http://a.historypointer.com/cgi-bin/mapserv?mode=tile&</url>" class="">http://a.historypointer.com/cgi-bin/mapserv?mode=tile&</url></a></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> </http></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> </source></div><p style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px; min-height: 20px;" class=""> <br class="webkit-block-placeholder"></p><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <tileset name="hpsites"></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <source>hpsites</source></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <cache>disk</cache></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <grid>WGS84</grid></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <format>PNG</format></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <metatile>5 5</metatile></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <metabuffer>10</metabuffer></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <expires>10</expires></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> </tileset></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px; min-height: 20px;" class=""><br class=""></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <default_format>PNG</default_format></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px; min-height: 20px;" class=""><br class=""></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <service type="tms" enabled="true"></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <full_wms>assemble</full_wms></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <resample_mode>bilinear</resample_mode></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <format>PNG</format></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <maxsize>4096</maxsize></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> </service></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <service type="wmts" enabled="true"/></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <service type="tms" enabled="true"/></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <service type="kml" enabled="true"/></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <service type="gmaps" enabled="true"/></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <service type="ve" enabled="true"/></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <service type="mapguide" enabled="true"/></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <service type="demo" enabled="true"/></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px; min-height: 20px;" class=""><br class=""></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <errors>report</errors></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""> <lock_dir>/var/www/mapcache/cache</lock_dir></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px; min-height: 20px;" class=""><br class=""></div><div style="font-family: 'Source Code Pro'; font-size: 16px; margin: 0px;" class=""></mapcache></div><div style="font-family: 'Source Code Pro'; font-size: 16px;" class=""><br class=""></div><div class="">Error log from Apache (note msTileSetup()…Tile parameter not set.)</div><div style="font-family: 'Source Code Pro'; font-size: 16px;" class=""><div style="margin: 0px;" class="">[Tue Apr 28 18:12:11 2015] [error] [client 162.17.176.230] wms request for tileset hpsites returned an unsupported format:\n<HTML>\n<HEAD><TITLE>MapServer Message</TITLE></HEAD>\n<!-- MapServer version 6.5-dev OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE -->\n<BODY BGCOLOR="#FFFFFF">\nmsTileSetup(): Web application error. Tile parameter not set.\n</BODY></HTML>, referer: <a href="http://www.historypointer.com/resourcesTest.html" class="">http://www.historypointer.com/resourcesTest.html</a></div></div><div style="font-family: 'Source Code Pro'; font-size: 16px;" class=""><br class=""></div></div></div></body></html>