Managing the remote cache

You can use an API to manage the remote policy cache. The MarinerServletApplication class provides methods for preloading the caches (or loading them), and flushing the caches.

You can use an API to manage the remote policy cache. The MarinerServletApplication class provides methods for preloading the caches (or loading them), and flushing the caches.

Preloading the cache

The API takes as input the URL to which the preload request is to be made. It causes a remote policy request to be sent to the URL with the Mariner-RequestType header set to 'policySet'. The response to this request from the remote policy server must be a set of policies contained within a rpdm:policies element. See Encoding remote policy responses for details of the response schema.

Where an entry is already present in the cache, it is replaced by the entry returned by the preload request. So you can use a preload request to refresh cache if you wish.

When entries are added to the cache during this kind of operation, all of the rules associated with cache size, cache control values, and quotas apply. However, retry does not apply to preload operations that fail.

Note:

A request to preload the caches can specify any amount of information from a single policy up to and including the entire contents of the remote policy server. Implementations of remote policy servers must be capable of handling requests with this breadth of scope.

Flushing the caches

MCS provides an API to allow part or all of any cache to be refreshed, including:

The result of the flush operation is that all the entries specified are removed from the cache. The next time a reference is made to one of these policies, its value will be retrieved from the remote policy server in the usual way.

Related topics