You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> warning **Note**`In-memory cache` can only store values of types that are supported by [the structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#javascript_types).
21
-
22
20
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.
23
21
24
22
In order to enable caching, import the `CacheModule` and call its `register()` method.
@@ -57,6 +55,8 @@ To add an item to the cache, use the `set` method:
57
55
awaitthis.cacheManager.set('key', 'value');
58
56
```
59
57
58
+
> warning **Note** The in-memory cache storage can only store values of types that are supported by [the structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#javascript_types).
59
+
60
60
The default expiration time of the cache is 5 seconds.
61
61
62
62
You can manually specify a TTL (expiration time in seconds) for this specific key, as follows:
0 commit comments