Skip to content

Commit bfa3fed

Browse files
committed
README update
1 parent 6ec6aa3 commit bfa3fed

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,16 @@ function getCachedUser(id, cb) {
7171
Second, node-cache-manager features a built-in memory cache (using [node-lru-cache](https://github.com/isaacs/node-lru-cache)),
7272
with the standard functions you'd expect in most caches:
7373

74-
set(key, val, ttl, cb)
74+
set(key, val, {ttl: ttl}, cb) // * see note below
7575
get(key, cb)
7676
del(key, cb)
7777

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+
7884
Third, node-cache-manager lets you set up a tiered cache strategy. This may be of
7985
limited use in most cases, but imagine a scenario where you expect tons of
8086
traffic, and don't want to hit your primary cache (like Redis) for every request.

0 commit comments

Comments
 (0)