Get or add cache

Cache a key-value pair using Orange Logic’s CacheService. Cached values are returned to validate subsequent calls.

GetOrAddCache: function (_sKey, _oOptions, _fGetNewValueCallback, _fValidateCallback, _fCallbackSuccess, _fCallBackFail)
+ _oOptions.ExpireInSeconds:

Request parameter attributes

AttributeTypeDescriptionRequired
KeystringThe key-value pair to be cached.yes
OptionsobjectThis object uses one property:
  • ExpireInSeconds: The cache duration. The default value is 600, meaning key-value pairs are cached for 10 minutes.
yes
GetNewValueCallbackfunctionA function called when a key-value pair is not in the cache or when the value is invalid, as determined by the validate callback.yes
ValidateCallbackfunctionA function called to validate the cached key-value pair.no