Operations Basics / Version 2310
Table Of ContentsTo view cache entries for a cache class or CacheKey
, use the endpoint’s entries
query parameter by making a
GET
request to /actuator/cache/<cacheClass>?entries=true
or /actuator/cache/<cacheClass>/<CacheKey>?entries=true
.
Note, that the endpoint implementation has to scan all cache entries to find matching entries. For large caches, this can be expensive, because the cache is temporarily locked against updates.
The following example requests entries for content properties that are cached internally by the Unified API:
curl http://localhost:8081/actuator/cache/com.coremedia.cap.heap/com.coremedia.cotopaxi.content.PropertiesKey?entries=true
The response body starts like this:
Response.
{ "count": 3327, "level": 27444160, "entries": { "total": 3327, "offset": 0, "limit": 10, "elements": [ { "keyClass": "com.coremedia.cotopaxi.content.PropertiesKey", "keyToString": "key.properties(448)", "weight": 432696, "dependencies": { "total": 1, "offset": 0, "limit": 10, "elements": [ { "class": "com.coremedia.cotopaxi.content.PropertiesDependency", "toString": "dependency.properties(coremedia:///cap/content/448)" } ] }, "dependents": { "total": 0, "offset": 0, "limit": 10, "elements": [] } }, { "keyClass": "com.coremedia.cotopaxi.content.PropertiesKey", "keyToString": "key.properties(202)", "weight": 80150, ...
The actual response is longer and shows the first 10 cache entries of 3327 in total, sorted by descending weight, so that the entry
that occupies the most space in the cache comes first. Each entry is listed with the name of its CacheKey
class (keyClass
) ,
the #toString
representation of the CacheKey
object (keyToString
), the space it occupies in the cache (weight
),
its dependencies
and dependents
.
You can control the output with additional optional query parameters:
Query Parameter | Default | Description |
---|---|---|
values |
| Set to |
entriesSort |
| Sort criteria for returned entries. Possible values are The sort direction can be specified by appending
a space character followed by Multi-level sorting can be specified by comma-separated
values, for example url-encoded query parameter |
entriesOffset | 0 | The number of cache entries to skip. |
entriesLimit | 10 | The maximum number of cache entries to return. |
dependenciesOffset | 0 | For each cache entry, the number of dependencies to skip. |
dependenciesLimit | 10 | For each cache entry, the maximum number of dependencies to return. |
dependentsOffset | 0 | For each cache entry, the number of dependents to skip. |
dependentsLimit | 10 | For each cache entry, the maximum number of dependents to return. |
stringLimit | 200 | For the string representation of keys, dependencies and values, the maximum length before strings get shortened in the response. Set to 0 to not return string representations. |
Note, that the endpoint calls CacheKey#toString
, the #toString
method of dependency objects,
and if values=true
, the #toString
method of cached values. Depending on the implementation of #toString
methods, these can be
expensive operations. You can avoid that #toString
methods are called by setting query parameter stringLimit
to 0
and not using the
keyToString
sort criteria.