Skip to content

Commit 764b4f2

Browse files
Merge pull request #2576 from Tony133/docs/add-warning-compatibility-cache-manager
docs(cache): added warning for cache manager compatibility
2 parents 74540fe + d53ded3 commit 764b4f2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

content/techniques/caching.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ First install [required packages](https://github.com/node-cache-manager/node-cac
1010
$ npm install cache-manager
1111
```
1212

13+
> info **Hint** As of version `>=9.2.1`, NestJS is compatible with both `cache-manager` v4 and v5.
14+
15+
> warning **Warning** `cache-manager` version 4 uses seconds for `TTL (Time-To-Live)`. The current version of `cache-manager` (v5) has switched to using milliseconds instead. NestJS doesn't convert the value, and simply forwards the ttl you provide to the library. In other words:
16+
> * If using `cache-manager` v4, provide ttl in seconds
17+
> * If using `cache-manager` v5, provide ttl in milliseconds
18+
> * Documentation is referring to seconds, since NestJS was released targeting version 4 of cache-manager.
19+
1320
#### In-memory cache
1421

1522
Nest provides a unified API for various cache storage providers. The built-in one is an in-memory data store. However, you can easily switch to a more comprehensive solution, like Redis.

0 commit comments

Comments
 (0)