Pcacher
Promisified cache for nodejs. Work on top of Redis. Also support in memory cache.
Install
npm install pcacher
Basic usage
var pcacher = ;var cache = ; cache;
Value
Value can be a function (can return a promise) or promise or any JSON-serialized object.
cache; cache;
Options
Options can be a object, in this case it will be interpreted as list of options. Or it can be String or Number, in this case it will be interpreted as TTL. There are follow options:
ns
reset
memory
ttl
String or Number of seconds. If a string, use follow patterns'2h'
or'15min'
. More detailed here.nocache
Boolean. Use it to off cache
cache;