Object Cache Pro

REST API

Object Cache Pro provides several REST API endpoints. All endpoints, their arguments and properties are discoverable at /objectcache/v1/ with OPTIONS requests.

Latency

Returns the latency of all connected servers and cluster nodes.

GET /objectcache/v1/latency

Response

[
{
"url": "tcp://127.0.0.1:6379",
"latency": 150
},
{
"url": "tcp://127.0.0.1:6380",
"error": "read error on connection"
},
// ...
]

Groups

Returns a list of currently stored cache groups.

GET /objectcache/v1/groups

Response

[
{ "group": "analytics", "count": 1337 },
{ "group": "default", "count": 42 },
{ "group": "options", "count": 108 },
{ "group": "post_meta", "count": 47 },
{ "group": "posts", "count": 13 },
// ...
]

Analytics

Returns computed or raw analytics, depending on the given context. Supports pagination parameters, the global _fields parameter as well as an interval parameter.

GET /objectcache/v1/analytics

To discover all all arguments and properties use an OPTIONS request:

curl -X OPTIONS "https://example.com/wp-json/objectcache/v1/analytics"

Response

[
{
"timestamp": 1649205350,
"date_display": {
"date": "Wed 6th",
"time": "00:35 - 00:36 GMT+0000"
},
"hits": { "median": 1674 },
"misses": { "median": 8 },
"hit-ratio": { "median": 99.52 },
// ...
},
// ...
]