2

Serving tiles from Geowebcache, I need to add ETag parameter to response headers. How can it would be happen?

Cache-Control: max-age=2629743, must-revalidate
Content-Length: 541947
Content-Type: application/vnd.mapbox-vector-tile
Date: Sun, 16 Aug 2020 07:16:14 GMT
Expires: Tue, 15 Sep 2020 17:45:17 GMT
geowebcache-cache-result: MISS
geowebcache-crs: EPSG:900913
geowebcache-gridset: EPSG:900913
geowebcache-tile-bounds: -20037508.34,-20037508.34,20037508.34,20037508.34
geowebcache-tile-index: [0, 0, 0]
Last-Modified: Wed, 15 Jul 2020 09:31:38 GMT
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
2
  • do you get an etag when you get a cache HIT?
    – Ian Turton
    Commented Aug 16, 2020 at 9:39
  • @IanTurton, there is no ETag in Hit or Miss mode. Commented Aug 16, 2020 at 10:15

1 Answer 1

1

In a stand-alone GeoWebCache the eTag computation must be enabled on a per layer basis, in the XML configuration file. From the XML schema of the config file:

      <xs:element name="useETags" type="xs:boolean" minOccurs="0">
        <xs:annotation>
          <xs:documentation xml:lang="en">
            (1.2.2) GeoWebCache can provide ETags based on the last time a
            tile was modified and
            thus support conditional gets. Note that most clients only refer to this tag
            once the
            data has expired, so set use small values for the client expiration.
            This functionality is not available if
            the metastore is disabled.
          </xs:documentation>
        </xs:annotation>
      </xs:element>

Also do check out the full schema.

1
  • Where the config file could be found in GeoWebCache path? Commented Sep 7, 2020 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.