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
Returns: `CacheStoreReadable | Promise<CacheStoreReadable | undefined> | undefined` - If the request is cached, a readable for the body is returned. Otherwise, `undefined` is returned.
34
+
Returns: `GetResult | Promise<GetResult | undefined> | undefined` - If the request is cached, the cached response is returned. If the request's method is anything other than HEAD, the response is also returned.
35
+
If the request isn't cached, `undefined` is returned.
36
+
37
+
Response properties:
38
+
39
+
***response**`CachedResponse` - The cached response data.
40
+
***body**`Readable | undefined` - The response's body.
Returns: `CacheStoreWriteable | undefined` - If the store is full, return `undefined`. Otherwise, return a writable so that the cache interceptor can stream the body and trailers to the store.
49
+
Returns: `Writable | undefined` - If the store is full, return `undefined`. Otherwise, return a writable so that the cache interceptor can stream the body and trailers to the store.
43
50
44
-
## `CacheStoreValue`
51
+
## `CachedResponse`
45
52
46
53
This is an interface containing the majority of a response's data (minus the body).
47
54
@@ -55,15 +62,11 @@ This is an interface containing the majority of a response's data (minus the bod
55
62
56
63
### Property `rawHeaders`
57
64
58
-
`(Buffer | Buffer[])[]` - The response's headers.
59
-
60
-
### Property `rawTrailers`
61
-
62
-
`string[] | undefined` - The response's trailers.
65
+
`Buffer[]` - The response's headers.
63
66
64
67
### Property `vary`
65
68
66
-
`Record<string, string> | undefined` - The headers defined by the response's `Vary` header
69
+
`Record<string, string | string[]> | undefined` - The headers defined by the response's `Vary` header
67
70
and their respective values for later comparison
68
71
69
72
For example, for a response like
@@ -95,22 +98,3 @@ This would be
95
98
is either the same sa staleAt or the `max-stale` caching directive.
96
99
97
100
The store must not return a response after the time defined in this property.
98
-
99
-
## `CacheStoreReadable`
100
-
101
-
This extends Node's [`Readable`](https://nodejs.org/api/stream.html#class-streamreadable)
102
-
and defines extra properties relevant to the cache interceptor.
103
-
104
-
### Getter: `value`
105
-
106
-
The response's [`CacheStoreValue`](#cachestorevalue)
107
-
108
-
## `CacheStoreWriteable`
109
-
110
-
This extends Node's [`Writable`](https://nodejs.org/api/stream.html#class-streamwritable)
111
-
and defines extra properties relevant to the cache interceptor.
112
-
113
-
### Setter: `rawTrailers`
114
-
115
-
If the response has trailers, the cache interceptor will pass them to the cache
0 commit comments