[mapserver-users] TR: "ows_http_max_age" have no effect...
Rousseau Lambert2, Louis-Philippe (EC)
louis-philippe.rousseaulambert2 at canada.ca
Thu Sep 19 11:25:01 PDT 2019
Oups sorry, pressed the shift key too soon... Here is the complete message/question:
Hi everyone!
I'm trying to set a cache-control maximum age for my web services and am having some difficulties making it work.
I have added the line `"ows_http_max_age" "10800"` in my mapfile (MAP.WEB.METADATA) but the response headers I get (from curl) does not have any cache-control value:
```
HTTP/1.0 200 OK
Date: Thu, 19 Sep 2019 18:08:46 GMT
Server: WSGIServer/0.1 Python/2.7.6
Content-type: image/png
Content-Length: 653383
```
I am using:
MapServer version 7.0.7 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG 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=THREADS SUPPORTS=GEOS SUPPORTS=POINT_Z_M INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
and here is a minimal working mapfile example, you can use any *TMP_TGL_2* data from
http://dd.weather.gc.ca/model_gem_global/25km/grib2/lat_lon/00/000/
```
MAP
NAME ""
IMAGETYPE PNG
EXTENT -180 -90 180 90
MAXSIZE 4096
SIZE 500 300
IMAGECOLOR 255 255 255
PROJECTION
"init=epsg:4326"
END
TRANSPARENT ON
DEBUG 5
WEB
METADATA
"ows_http_max_age" "10800"
"ows_extent" "-180 -90 180 90"
"wms_getmap_formatlist" "image/png,image/jpeg"
"ows_enable_request" "*"
"ows_srs" "EPSG:4326"
"ows_title" "example"
END
END
LAYER
NAME "GDPS"
DEBUG 5
TYPE RASTER
TOLERANCE 15
TEMPLATE "ttt.html"
PROJECTION
"proj=longlat"
"a=6371229"
"b=6371229"
"no_defs"
"pm=-359.88"
END
DATA '/path/to/model_gem_global/25km/grib2/lat_lon/00/015/CMC_glb_TMP_TGL_2_latlon.24x.24_2019091900_P015.grib2'
METADATA
"ows_title" "GDPS"
"ows_include_items" "all"
"ows_abstract" "stuf"
"ows_extent" "-180 -90.24 180 90"
"ows_geomtype" "Geometry"
"ows_size" "1500 751"
"gml_include_items" "all"
END
CLASSGROUP "TEMPERATURE-LINEAR"
CLASS
NAME "1"
GROUP "TEMPERATURE-LINEAR"
EXPRESSION ([pixel] < 0)
STYLE
COLORRANGE 0 0 255 0 255 0
DATARANGE -100.0 0
END
END
CLASS
NAME "2"
GROUP "TEMPERATURE-LINEAR"
EXPRESSION ([pixel] >= 0)
STYLE
COLORRANGE 0 255 0 255 0 0
DATARANGE 0 50
END
END
END
END
Thanks
LP
________________________________
De : Rousseau Lambert2, Louis-Philippe (EC)
Envoyé : 19 septembre 2019 14:13
À : mapserver-users at lists.osgeo.org
Objet : "ows_http_max_age" have no effect...
Hi everyone!
I'm trying to set a cache-control maximum age for my web services and am having some difficulties making it work.
I have added the line `"ows_http_max_age" "10800"` in my mapfile (MAP.WEB.METADATA) but the response headers I get does not have any cache-control value:
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20190919/dfa1e859/attachment.htm>
More information about the MapServer-users
mailing list