File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -71,10 +71,16 @@ function getCachedUser(id, cb) {
71
71
Second, node-cache-manager features a built-in memory cache (using [ node-lru-cache] ( https://github.com/isaacs/node-lru-cache ) ),
72
72
with the standard functions you'd expect in most caches:
73
73
74
- set(key, val, ttl, cb)
74
+ set(key, val, { ttl: ttl} , cb) // * see note below
75
75
get(key, cb)
76
76
del(key, cb)
77
77
78
+ // * Note that depending on the underlying store, you may be able to pass the
79
+ // ttl as the third param, like this:
80
+ set(key, val, ttl, cb)
81
+ // ... or pass no ttl at all:
82
+ set(key, val, cb)
83
+
78
84
Third, node-cache-manager lets you set up a tiered cache strategy. This may be of
79
85
limited use in most cases, but imagine a scenario where you expect tons of
80
86
traffic, and don't want to hit your primary cache (like Redis) for every request.
You can’t perform that action at this time.
0 commit comments