Aperture's Cache can be used to reduce the load on a service by caching the results of expensive computations. It is built on top of a reliable distributed cache so that each Aperture Agent can quickly and efficiently operate on the cached data.
Create an instance of Aperture
Flowby calling the
StartFlowmethod with the
resultCacheKeyparameter set to your desired value. The first call will let Aperture initialize a cache entry for the flow, uniquely identified by the
ResultCacheKeyvalues. Subsequent calls will return the cached value as part of the response object.
The value stored in the cache can be retrieved by calling the
ResultCachemethod on the
Flowobject. It returns an object that can be used to perform the following operations:
GetLookupStatus- retrieve the status of the lookup operation, whether it was a
GetError- retrieve the error that occurred during the lookup operation.
GetValue- retrieve the cached value.
While the flow is active, the following additional Cache related operations can be performed on the
SetResultCache- set the cached value.
DeleteResultCache- delete the cached value.
EndFlowmethod to complete the flow.
Additionally, Aperture also provides a Global Cache that can be used to access
cached data across multiple flows. This is useful when the same data is required
by multiple flows. The Global Cache can be accessed via the
key parameter on the
Flow object. It returns the same object as
Delete methods can be used to set and
delete entries in the Global Cache.