Method: Geoserver::Publish::Geowebcache#masstruncate

Defined in:
lib/geoserver/publish/geowebcache.rb

#masstruncate(layer_name:, request_type: "truncateLayer") ⇒ Object

This will masstruncate all caches for a given layer. Note: that this implementation differs from the GWC Rest documentation which seems to be wrong. See: github.com/GeoWebCache/geowebcache/issues/785



16
17
18
19
20
21
22
23
# File 'lib/geoserver/publish/geowebcache.rb', line 16

def masstruncate(layer_name:, request_type: "truncateLayer")
  payload = "<#{request_type}><layerName>#{layer_name}</layerName></#{request_type}>"
  connection.post(
    path: "masstruncate",
    payload: payload,
    content_type: "text/xml"
  )
end