close

Filter

loading table of contents...

Operations Basics / Version 2207

Table Of Contents

4.10.3.2 Retrieving CacheKey Classes

For each cache class, different com.coremedia.cache.CacheKey classes may be used to evaluate and get cached values. You can use the keys query parameter to retrieve all used CacheKey classes for some cache class by making a GET request to /actuator/cache/<cacheClass>?keys=true as in the following example.

Note, that the endpoint implementation has to scan all cache entries to find the CacheKey classes. For large caches, this can be expensive, because the cache is temporarily locked against updates.

curl http://localhost:8081/actuator/cache/com.coremedia.cap.heap?keys=true

The response lists used CacheKey classes with the number of cache entries and the level indicating how much space they occupy of the cache class capacity. For example, a response may start like this:

Response. 

{
  "capacity": 104857600,
  "level": 88905639,
  "keys": {
    "com.coremedia.cap.undoc.multisite.impl.VariantsCacheKey": {
      "count": 6,
      "level": 6364,
      "href": "http://localhost:8081/actuator/cache/com.coremedia.cap.heap/com.coremedia.cap.undoc.multisite.impl.VariantsCacheKey"
    },
    "com.coremedia.cotopaxi.content.ChildrenKey": {
      "count": 983,
      "level": 493484,
      "href": "http://localhost:8081/actuator/cache/com.coremedia.cap.heap/com.coremedia.cotopaxi.content.ChildrenKey"
    }

The "href" links in the JSON response can be used to get information about a single CacheKey class. These links are only present if the actuator endpoint is invoked over HTTP. Like many other endpoints, the cache endpoint may also be exposed and invoked over JMX, in which case the response will not contain such links.

To retrieve the count and level of a single CacheKey class in a cache class, make a GET request to /actuator/cache/<cacheClass>/<CacheKey>, for example:

curl http://localhost:8081/actuator/cache/com.coremedia.cap.heap/com.coremedia.cotopaxi.content.ChildrenKey

The response will look like

Response. 

{
  "count": 983,
  "level": 493484
}

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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