Skip to content

Commit 5ce503b

Browse files
Update caching.md
1 parent 0f79370 commit 5ce503b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/techniques/caching.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ $ npm install @nestjs/cache-manager cache-manager
1717
1818
#### In-memory cache
1919

20-
> 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-
2220
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.
2321

2422
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:
5755
await this.cacheManager.set('key', 'value');
5856
```
5957

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+
6060
The default expiration time of the cache is 5 seconds.
6161

6262
You can manually specify a TTL (expiration time in seconds) for this specific key, as follows:

0 commit comments

Comments
 (0)