Table of Contents
CacheDo
Cache abstraction that supports merging cached values with new and key hashing
Parameters
-
cacheClass
Class Caching class with get, put, del methods -
options
JSON Class operation definition-
options.merge
Boolean (false) Enable/Disable merging new value with present value if one exists -
options.keys
JSON Defines options specific to key management -
options.ttl
Number (600) Define expire time of the cached value -
options.timeoutCB
(Undefined | Function) (Undefined) Custom callback function to be executed when cache value expires
-
Meta
- version: 1.0.0
setCache
Validates caching function by ensuring that it contains methods get, put, del
Parameters
-
cacheClass
Function Caching function
setOptions
Merges and returns a validated option set
Parameters
-
options
JSON Class operation definition-
options.merge
Boolean (false) Enable/Disable merging new value with present value if one exists -
options.keys
JSON Defines options specific to key management -
options.ttl
Number (600) Define expire time of the cached value -
options.timeoutCB
(Undefined | Function) (Undefined) Custom callback function to be executed when cache value expires
-
hashKey
Produces hash of parameter.
Parameters
setKet
Generates key based on configuration settings
Parameters
put
Pushes key/value pair to cache
Parameters
-
key
String -
value
(Number | String | JSON) Value to be cached -
options
JSON Optional options passed that will override options used during class instantiation
get
Calls cache to return value assigned to key
Parameters
-
key
String