diff --git a/mapcache/Dockerfile b/mapcache/Dockerfile index 834ff10e45edab99f2165cb9ce72d76a62218e65..05adbcdf5cbbcb98278fdc233fcfe0a9eb94682d 100644 --- a/mapcache/Dockerfile +++ b/mapcache/Dockerfile @@ -54,9 +54,9 @@ RUN mkdir -p /build_deps && cd /build_deps \ && apt-get install -y zlib1g-dev libpng-dev libjpeg-turbo8 libfreetype6 libfribidi-dev libharfbuzz-dev libcairo2-dev libfcgi-dev libgeos++-dev postgresql postgis libxml2-dev libgif-dev libjpeg-turbo8-dev libprotobuf-dev protobuf-compiler libprotobuf-c-dev libprotobuf-c1 libprotobuf-dev protobuf-c-compiler \ && apt-get -y clean \ && git clone https://github.com/mapserver/mapcache.git && cd mapcache \ - && git checkout fa73ef28ae5d56ae817e0f0ee47aaed04b8d67f3 \ + && git checkout c467a3bb444cab69c52bc78b91b9bae3a9415f2f \ && mkdir -p build && cd build \ - && cmake .. -DWITH_MEMCACHE=1 -DCMAKE_BUILD_TYPE="Debug" \ + && cmake .. \ # -DWITH_MEMCACHE=1 -DCMAKE_BUILD_TYPE="Debug" \ && make -j$(nproc) \ && make install diff --git a/mapcache/mapcache_template.xml b/mapcache/mapcache_template.xml index 19efcfbd4a71085f05d2844e7e71723d80a6f571..e73c0a8ec06c28214325021c404cb082b66bf141 100644 --- a/mapcache/mapcache_template.xml +++ b/mapcache/mapcache_template.xml @@ -294,7 +294,9 @@ </keywords> </metadata> <format>png_basic</format> + {% if basemap_autoexpire != 0 %} <auto_expire>{{ basemap_autoexpire }}</auto_expire> + {% endif %} </tileset> <tileset name="{{ plat }}_abi_graticules"> <source>{{ plat }}_abi_graticules</source> diff --git a/mapcache/render.py b/mapcache/render.py index fd1fc11157681929c90fdaef32b9bc858dd25dbf..4cb5b67f14c828a7ee5b8667f74940e237522753 100644 --- a/mapcache/render.py +++ b/mapcache/render.py @@ -18,8 +18,12 @@ products = ["C{:02d}".format(x) for x in range(1, 17)] + ["true_color"] products = os.getenv("MAPCACHE_PRODUCTS", " ".join(products)).split(" ") platforms = "g16 g17" platforms = os.getenv("MAPCACHE_PLATFORMS", platforms).split(" ") -image_autoexpire = os.getenv("IMAGE_AUTOEXPIRE", "86400") -basemap_autoexpire = os.getenv("BASEMAP_AUTOEXPIRE", "86400") +# 86400 = 24 hours +# this does not control when tiles are deleted from the cache, but rather +# when they should be re-requested. A value of 0 means never re-request. +# A non-zero value can be a good safety net to just make sure things are updated. +image_autoexpire = os.getenv("IMAGE_AUTOEXPIRE", str(86400 * 7)) +basemap_autoexpire = os.getenv("BASEMAP_AUTOEXPIRE", "0") wms_host = os.environ['WMS_HOST'] wms_port = os.environ['WMS_PORT']