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
-`{ maxAge?: number, immutable?: boolean }` - `Cache-Control: public, max-age=YOUR_MAX_AGE_or_31536000000`, also `, immutable` can be added if you set the `immutable` option to `true`
202
+
-`{ maxAge?: number, immutable?: boolean }` - `Cache-Control: public, max-age=YOUR_MAX_AGE_IN_SECONDS_or_31536000`, also `, immutable` is added when you set the `immutable` option to `true`
203
+
204
+
Numeric `cacheControl` and `cacheControl.maxAge` values are interpreted as milliseconds, clamped to `0..31536000000`, and converted to seconds for the response header.
203
205
204
206
Enable or disable setting `Cache-Control` response header.
205
207
206
208
### cacheImmutable
207
209
208
210
Type: `Boolean`
209
-
Default: `undefined`
211
+
Default: `true`
210
212
211
213
Enable or disable setting `Cache-Control: public, max-age=31536000, immutable` response header for immutable assets (i.e. asset with a hash like `image.a4c12bde.jpg`).
212
214
Immutable assets are assets that have their hash in the file name therefore they can be cached, because if you change their contents the file name will be changed.
213
-
Take preference over the `cacheControl` option if the asset was defined as immutable.
215
+
When omitted, immutable assets use this header by default.
216
+
Set `cacheImmutable: false` to fall back to the `cacheControl` option even for immutable assets.
217
+
This takes precedence over the `cacheControl` option only when the asset was defined as immutable and `cacheImmutable` is not `false`.
0 commit comments