Operations Basics / Version 2404
Table Of ContentsTo 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/cacheThe 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.ObjectAgain, 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
}
}


