Does anyone know if it's possible to truncate a GeoServer/GeoWebCache layer by viewparameter but ignore any env parameters?

We want to be able to truncate all tiles generated with viewparam=WhateverParamer:1 regardless of the env parameters supplied when the tile was requested/generated.

For example; We may have a layer that has a single viewparam but 2 env parameters. When we go to truncate, we don't want to remove all the layer tiles (e.g. can't be done with /masstruncate) but only the tiles generated with viewparam=WhateverParamer:1. This means we have to send a truncate request for every possible combination of those 2 env parameters * the available values for those env parameters. If the env parameter can have a large number of possible values, this can lead to having to send a huge number of requests to truncate the layer.

We've tried a few different things to get this to work:

  1. Send the truncate request supplying the viewparam but without the env param - This truncates nothing because all tiles were generated with at least one env param

<?xml version="1.0" encoding="UTF-8"?> <seedRequest> <name>layer_name</name> <type>truncate</type> <gridSetId>EPSG:900913</gridSetId> <zoomStart>0</zoomStart> <zoomStop>30</zoomStop> <format>image/png</format> <threadCount>16</threadCount> <parameters> <entry> <string>viewparams</string> <string>WhateverParamer:1</string> </entry> </parameters> </seedRequest>

  1. Use the masstruncate endpoint and attempt to supply the viewparams - This truncates nothing because I don't believe this is what this was intended for (I think this has to do with orphaned parameter filter tiles)

<truncateParameters> <layerName>layer_name</layerName> <parameters> <entry> <string>viewparams</string> <string>WhateverParamer:1</string> </entry> </parameters> </truncateParameters>

  1. Even supplying the env entry but leaving it blank, using a wildcard, regex...just about everything we could think of. - Still truncates nothing without explicitly supplying the env param the tile was generated with.
  2. Each of these combinations using both XML and form-encoded request.

Does anyone have any suggestions on how we can accomplish this without sending a huge number of requests?


It looks like this has come up before on the Geoserver User Mailing List and looking through the Github issues/PRs it appears that there have been merged PRs dealing with this #360 & #359...however I haven't been able to glean if or how this helps solve this issue...nor how I might modify the truncate request to take advantage of these changes.

1 Answer 1


At the moment, this is not possible. You can truncate one particular parameterization, or all of them but you can not hold one filtered parameter fixed while truncating across all values of another.

The PR you found was for truncating all paramaterizations within a fixed bounding box.

As GWC is FOSS, you could add the feature if you have Java development capacity or hire a developer to do it for you.


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.