API Management

Populate Cache

This policy provides a way to store data which can be shared across API resources and Projects. The data stored can be retrieved using the Lookup Cache Policy.

Configuration

Policy configuration contains a source element which is extracted from the input and added to the cache. The properties that have to be configured to use the policy are described below.

CachePopulate.jpg
Figure 1: Populate Cache Policy Configuration attributes

Property

Description

Cache Name

Name of the cache to be used to add an entry. If a Cache does not exist with the name given, a new Cache will be created.

Distributed

This option is used to fetch data from the distributed database (Cassandra). If disabled, it fetches data from the cache memory in the local machine.

Key

The

part

of the message or a constant that identifies the key with which the cache has to be queried for a value.

Value Source

The part of the message or a constant whose value should be stored as the one corresponding to the key in the cache.

Time to Idle Seconds

The maximum number of seconds an element can exist in the cache without being accessed. The element expires at the set limit and will no longer be returned from the cache. The default value is 0, which means no TTI eviction takes place (infinite lifetime).

Time to Live Seconds

The maximum number of seconds an element can exist in the cache regardless of use. The element expires at this limit and will no longer be returned from the cache. The default value is 0, which means no TTL eviction takes place (infinite lifetime).

Example

In the example Invoking OAuth and Caching Access Tokens, the token is inserted into the cache using this policy.