close

Filter

loading table of contents...

Operations Basics / Version 2406.0

Table Of Contents

4.10.3.6 Trigger Cache Eviction

To trigger a cache eviction, make a POST request to /actuator/cache with a JSON body as in the following example:

curl -X POST -H "Content-Type: application/json" \
     -d '{"evict": true}' \
     http://localhost:8081/actuator/cache

The response includes a message stating for which cache classes an eviction was triggered, and the state of the cache afterwards, as it would be returned by a GET request to the same URL. The following example just shows the start of the response body:

Response. 

{
  "message": "Cache eviction triggered for cache classes: [com.coremedia.cap.disk, ...",
  "result": {
...

To trigger a cache eviction for a single cache class only, a similar POST request can be made to /actuator/cache/<cacheClass> as in the following example:

curl -X POST -H "Content-Type: application/json" \
     -d '{"evict": true}' \
     http://localhost:8081/actuator/cache/java.lang.Object

Again, the response includes a message about the operation and the state of the cache class afterwards:

Response. 

{
  "message": "Cache eviction triggered for cache class: 'java.lang.Object'.",
  "result": {
    "capacity": 10000,
    "level": 107
  }
}

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.