module:cache
- Description:
Cache module for shared cache and subscriptions.
Some drivers (Redis) may support TTL so global
options.ttlor localoptions.ttlcan be used forput/incroperations and it will honored if it is suported.For caches that support maps, like Redis the
options.mapNamecan be used with get/put/incr/del to work with maps and individual keys inside maps.All methods use
options.cacheNamefor non-default cache. If it is an array then a client will be picked sequentially by maintaining internal sequence number.Empty
defaultclient always exists, it can be overridden to make default some other driverAll public
cache.get|put|incr|del|lock|unlock|limiteroperations have corresponding promisifed methods starting witha, likecache.get->cache.aget.To enable stats collection for a cache it must be enabled with config:
cache-redis-options-metrics=1
Example
cache-default=redis://
cache-redis=redis://?bk-enable_offline_queue=1
cache-config={ "limiter": "local://", "redis": "redis://" }
Classes
Members
(inner) args :Array.<ConfigOptions>
Type:
- Array.<ConfigOptions>