<div dir="ltr">Hi,<div><br></div><div>I am using Mapserver to render a GeoTIFF in s3 using /vsicurl/. My raster layer uses a tile index generated by Postgis. Here's a snippet from my MAP file:</div><div><br></div><div><div> CONFIG "CPL_VSIL_CURL_ALLOWED_EXTENSIONS" ".tif"</div><div> CONFIG "GDAL_DISABLE_READDIR_ON_OPEN" "YES"</div><div> CONFIG "VSI_CACHE" "FALSE"</div></div><div><span style="white-space:pre"><br></span></div><div><span style="white-space:pre"> ...</span><br></div><div><br></div><div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>LAYER</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>NAME<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>update_test</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>TILEINDEX<span style="white-space:pre"> my_tindex</span><br></div><div><span style="white-space:pre"> </span><span style="white-space:pre">TILEITEM </span><span style="white-space:pre"> </span><span style="white-space:pre">"location"</span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>TYPE<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>RASTER</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>END<br></div></div><div><div><br></div><div><div><span style="white-space:pre"> </span>LAYER</div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>NAME my_tindex</div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>TYPE POLYGON</div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>STATUS OFF<br></div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>INCLUDE "postgis.inc.map"</div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>DATA "geom FROM (</div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>SELECT</div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>id,</div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>geom,</div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>'/vsicurl/<a href="https://s3.amazonaws.com/pschmitt-public/current.tif">https://s3.amazonaws.com/pschmitt-public/current.tif</a>' as location<br></div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>FROM t<br></div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>WHERE ST_Intersects(t.geom, !BOX!)</div><div><span style="white-space:pre"> </span><span style="white-space:pre"> </span>) AS subquery USING UNIQUE id USING SRID=4326"</div></div><div><span style="white-space:pre"> </span>END</div><div><br></div><div>current.tif starts out as a red image: <a href="https://s3.amazonaws.com/pschmitt-public/red.tif">https://s3.amazonaws.com/pschmitt-public/red.tif</a></div><div><br></div><div>When I make WMS requests, I see red tiles, as expected. At some point in time, I overwrite current.tif with this blue image: <a href="https://s3.amazonaws.com/pschmitt-public/blue.tif">https://s3.amazonaws.com/pschmitt-public/blue.tif</a></div><div><br></div><div>However, when I make new WMS requests, Mapserver still returns red tiles! </div><div><br></div><div>If I restart Mapserver, I get blue tiles. If I then overwrite s3://pschmitt-public/current.tif with the red image, I continue to see blue WMS tiles until I restart Mapserver. It seems Mapserver is caching the raster somehow when using /vsicurl/. (side-note: whatever caching is going on sure is helpful when serving static imagery with /vsicurl/! Subsequent requests to render rasters are pretty quick after an initial render).</div><div><div><br></div><div>This does not happen if I store current.tif on local storage on my instance & update my tile index location to be something like "/data/current.tif". When I overwrite current.tif stored locally with red.tif and make new WMS requests, I get red tiles. When I overwrite current.tif stored locally with blue.tif and make new WMS requests, I get blue tiles.</div></div><div><br></div><div>Can anyone shed some light on this? How can I update imagery in s3 served via Postgis tile index pointing to /vsicurl/ paths without restarting mapserver?</div><div><br></div><div>Thanks!</div><div class="gmail_signature">Pete</div>
</div></div>