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: README.md
+18-11
Original file line number
Diff line number
Diff line change
@@ -122,7 +122,7 @@ curl https://myserver.dev/user?force=true # MISS (forcing invalidation)
122
122
123
123
##### cache
124
124
125
-
Type: `boolean`<br>
125
+
Type: `boolean`<br/>
126
126
Default: `new Keyv({ namespace: 'ssr' })`
127
127
128
128
The cache instance used for backed your pre-calculated server side response copies.
@@ -133,7 +133,7 @@ If you don't specify it, a memory cache will be used.
133
133
134
134
##### ttl
135
135
136
-
Type: `number`<br>
136
+
Type: `number`<br/>
137
137
Default: `7200000`
138
138
139
139
Number of milliseconds a cache response is considered valid.
@@ -146,21 +146,21 @@ If you don't provide one, this be used as fallback for avoid keep things into ca
146
146
147
147
##### serialize
148
148
149
-
Type: `function`<br>
149
+
Type: `function`<br/>
150
150
Default: `JSON.stringify`
151
151
152
152
Set the serializer method to be used before compress.
153
153
154
154
##### deserialize
155
155
156
-
Type: `function`<br>
156
+
Type: `function`<br/>
157
157
Default: `JSON.parse`
158
158
159
159
Set the deserialize method to be used after decompress.
160
160
161
161
##### compress
162
162
163
-
Type: `boolean`<br>
163
+
Type: `boolean`<br/>
164
164
Default: `false`
165
165
166
166
Enable compress/decompress data using brotli compression format.
@@ -173,7 +173,7 @@ npm install iltorb
173
173
174
174
##### revalidate
175
175
176
-
Type: `function`|`number`<br>
176
+
Type: `function`|`number`<br/>
177
177
Default: `ttl => ttl / 24`
178
178
179
179
Number of milliseconds that indicates grace period after response cache expiration for refreshing it in the background. the latency of the refresh is hidden from the user.
@@ -182,10 +182,17 @@ You can provide a function, it will receive [`ttl`](#ttl) as first parameter or
182
182
183
183
The value will be associated with [`stale-while-revalidate`](https://www.mnot.net/blog/2014/06/01/chrome_and_stale-while-revalidate) directive.
184
184
185
+
##### getKey
186
+
187
+
Type: `function`<br/>
188
+
Default: `req => normalizeUrl(req.url)`
189
+
190
+
It determinates how the cache key should be computed using `req` as input.
191
+
185
192
##### get
186
193
187
-
_Required_<br>
188
-
Type: `function`<br>
194
+
_Required_<br/>
195
+
Type: `function`<br/>
189
196
190
197
The method to be called for creating a fresh cacheable response associated with the current route path.
191
198
@@ -207,8 +214,8 @@ Any other property can be specified and will passed to `.send`.
207
214
208
215
##### send
209
216
210
-
_Required_<br>
211
-
Type: `function`<br>
217
+
_Required_<br/>
218
+
Type: `function`<br/>
212
219
213
220
The method used to determinate how the content should be rendered.
214
221
@@ -289,7 +296,7 @@ You can have a better overview of the percentage of success by looking your Clou
0 commit comments