Cache Command

Command Purpose

The cache command is used to manage JSLEE service caches.

Command Syntax

Show Cache Status

Information about the configured in-memory caches can be retrieved using the status action:

cache status [filter]

Refresh a Cache

A cache may need to be refreshed, by clearing and reloading cache data. Depending on the cache, this may wipe all cache data, or be performed by

cache refresh <cache> [node] [service] 

A specific cache may be refreshed by calling the cache refresh command. Optional node and service name parameters can request the cache refresh is performed only against the named cache in a single node, or a single service on a single node.

Inspect a Cache

The value of a key within a cache can be printed out. The value of the key is printed using the value’s toString() Java method, and is printed for each in-memory cache matching the given name and key. This allows the cache data to be compared across nodes and services.

cache inspect <cache> <key>

Note that the key must match exactly the key lookup into the cache. This command only works with caches using strings as the cache key.

Delete a Cache Key

Sometimes a cache key is out of date due to errors. It is possible to delete a cache key within a running system:

cache remove <cache> <key> [node] [service]

It is possible to direct the cache key removal at a specific cache. After the cache key is removed, the command will request from the cache the same key. This will force the reload/repopulation of the data from the backing store used by the cache, if such a store exists (otherwise the cache lookup acts as a noop and has no impact).