I published around 1000 layers in geoserver without enabling tile caching for layer.

How to check a cache is enabled for a layer or not?

How to enable tile caching (check box) for a layer under Tile Caching tab using python or Curl?

enter image description here


As with all questions relating to a REST API the trick is to make the change once using the GUI and then request that resource from the REST API and see what the required change is.

So you need to find out about a cached layer so goto (e.g.):


which returns:


The key line looks like <enabled>true</enabled> so I would think that for each layer you have you could POST an XML file like that with the layer name changed to that end point.

curl -v -u admin:geoserver -X PUT -H 'content-type: text/xml' -d @test2.xml http://localhost:8080/geoserver/gwc/rest/layers/topp:states

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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