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
Copy file name to clipboardExpand all lines: deps/undici/src/docs/docs/api/CacheStore.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,28 @@ The `MemoryCacheStore` stores the responses in-memory.
13
13
14
14
**Options**
15
15
16
+
-`maxSize` - The maximum total size in bytes of all stored responses. Default `Infinity`.
16
17
-`maxCount` - The maximum amount of responses to store. Default `Infinity`.
17
-
-`maxEntrySize` - The maximum size in bytes that a response's body can be. If a response's body is greater than or equal to this, the response will not be cached.
18
+
-`maxEntrySize` - The maximum size in bytes that a response's body can be. If a response's body is greater than or equal to this, the response will not be cached. Default `Infinity`.
19
+
20
+
### Getters
21
+
22
+
#### `MemoryCacheStore.size`
23
+
24
+
Returns the current total size in bytes of all stored responses.
25
+
26
+
### Methods
27
+
28
+
#### `MemoryCacheStore.isFull()`
29
+
30
+
Returns a boolean indicating whether the cache has reached its maximum size or count.
31
+
32
+
### Events
33
+
34
+
#### `'maxSizeExceeded'`
35
+
36
+
Emitted when the cache exceeds its maximum size or count limits. The event payload contains `size`, `maxSize`, `count`, and `maxCount` properties.
37
+
18
38
19
39
### `SqliteCacheStore`
20
40
@@ -26,7 +46,7 @@ The `SqliteCacheStore` is only exposed if the `node:sqlite` api is present.
26
46
27
47
-`location` - The location of the SQLite database to use. Default `:memory:`.
28
48
-`maxCount` - The maximum number of entries to store in the database. Default `Infinity`.
29
-
-`maxEntrySize` - The maximum size in bytes that a resposne's body can be. If a response's body is greater than or equal to this, the response will not be cached. Default `Infinity`.
49
+
-`maxEntrySize` - The maximum size in bytes that a response's body can be. If a response's body is greater than or equal to this, the response will not be cached. Default `Infinity`.
***connections**`number | null` (optional) - Default: `null` - The number of `Client` instances to create. When set to `null`, the `Pool` instance will create an unlimited amount of `Client` instances.
22
+
***clientTtl**`number | null` (optional) - Default: `null` - The amount of time before a `Client` instance is removed from the `Pool` and closed. When set to `null`, `Client` instances will not be removed or closed based on age.
***requestTls**`BuildOptions` (optional) - Options object passed when creating the underlying socket via the connector builder for the request. It extends from [`Client#ConnectOptions`](/docs/docs/api/Client.md#parameter-connectoptions).
27
27
***proxyTls**`BuildOptions` (optional) - Options object passed when creating the underlying socket via the connector builder for the proxy server. It extends from [`Client#ConnectOptions`](/docs/docs/api/Client.md#parameter-connectoptions).
28
+
***proxyTunnel**`boolean` (optional) - By default, ProxyAgent will request that the Proxy facilitate a tunnel between the endpoint and the agent. Setting `proxyTunnel` to false avoids issuing a CONNECT extension, and includes the endpoint domain and path in each request.
0 commit comments