[mapserver-users] Mapserver caching and /vsicurl/

Peter Schmitt pschmitt at gmail.com
Wed Apr 19 10:52:51 PDT 2017


Hi,

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:

        CONFIG "CPL_VSIL_CURL_ALLOWED_EXTENSIONS" ".tif"
        CONFIG "GDAL_DISABLE_READDIR_ON_OPEN" "YES"
        CONFIG "VSI_CACHE" "FALSE"

...

LAYER
NAME update_test
TILEINDEX my_tindex
TILEITEM "location"
TYPE RASTER
END

LAYER
NAME my_tindex
TYPE POLYGON
STATUS OFF
INCLUDE "postgis.inc.map"
DATA "geom FROM (
SELECT
id,
geom,
'/vsicurl/https://s3.amazonaws.com/pschmitt-public/current.tif' as location
FROM t
WHERE ST_Intersects(t.geom, !BOX!)
) AS subquery USING UNIQUE id USING SRID=4326"
END

current.tif starts out as a red image:
https://s3.amazonaws.com/pschmitt-public/red.tif

When I make WMS requests, I see red tiles, as expected.  At some point in
time, I overwrite current.tif with this blue image:
https://s3.amazonaws.com/pschmitt-public/blue.tif

However, when I make new WMS requests, Mapserver still returns red tiles!

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).

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.

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?

Thanks!
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170419/fafac700/attachment-0001.html>


More information about the mapserver-users mailing list