Get and Delete Cached Data using API
You can retrieve and delete cached data using the following actuator API endpoints:
note
You must have administrator access to use these endpoints.
Method | Endpoint | Usage |
---|---|---|
GET | /actuator/jcaches | Retrieves cache mode and cache names configured in deploy-caches.yaml |
GET | /actuator/jcaches/{cacheName}?key={key} | Retrieves data from specified cache |
DELETE | /actuator/jcaches/ | Deletes data from all caches |
DELETE | /actuator/jcaches/{cacheName} | Deletes data from the specified cache |
Note: API responses only contain information about on the caches enabled in the deploy-caches.yaml
.
The DELETE methods can be used to delete stale or unwanted cache entries without restarting the Deploy server, the Infinispan server, or the associated Deploy node.
Here is a sample call and response with standalone mode enabled:
GET http://localhost:43179/actuator/jcaches/
{
"configured": {
"cacheEnabled": true
},
"evaluated": {
"cacheMode": "standalone",
"provider": "org.infinispan.jcache.remote.JCachingProvider@16541025",
"providerAvailable": true
},
"caches": [
"LICENSE_CI_COUNT",
"CI_PK_CACHE",
"CI_PATH_CACHE"
]
}