+1
-1
| { | ||
| "name": "cacheable", | ||
| "version": "1.10.1", | ||
| "version": "1.10.2", | ||
| "description": "High Performance Layer 1 / Layer 2 Caching with Keyv Storage", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+24
-0
@@ -35,2 +35,3 @@ [<img align="center" src="https://cacheable.org/logo.svg" alt="Cacheable" />](https://github.com/jaredwray/cacheable) | ||
| * [Non-Blocking Operations](#non-blocking-operations) | ||
| * [Non-Blocking with @keyv/redis](#non-blocking-with-keyvredis) | ||
| * [CacheSync - Distributed Updates](#cachesync---distributed-updates) | ||
@@ -260,2 +261,25 @@ * [Cacheable Options](#cacheable-options) | ||
| # Non-Blocking with @keyv/redis | ||
| `@keyv/redis` is one of the most popular storage adapters used with `cacheable`. It provides a Redis-backed cache store that can be used as a secondary store. It is a bit complicated to setup as by default it causes hangs and blocking with its default configuration. To get past this you will need to configure the following: | ||
| Construct your own Redis client via the `createClient()` method from `@keyv/redis` with the following options: | ||
| * Set `disableOfflineQueue` to `true` | ||
| * Set `socket.reconnectStrategy` to `false` | ||
| In the KeyvRedis options: | ||
| * Set `throwOnConnectError` to `false` | ||
| In the Cacheable options: | ||
| * Set `nonBlocking` to `true` | ||
| We have also build a function to help with this called `createKeyvNonBlocking` inside the `@keyv/redis` package after version `4.6.0`. Here is an example of how to use it: | ||
| ```javascript | ||
| import { Cacheable } from 'cacheable'; | ||
| import { createKeyvNonBlocking } from '@keyv/redis'; | ||
| const secondary = createKeyvNonBlocking('redis://user:pass@localhost:6379'); | ||
| const cache = new Cacheable({ secondary, nonBlocking: true }); | ||
| ``` | ||
| # GetOrSet | ||
@@ -262,0 +286,0 @@ |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
208091
0.56%709
3.5%