@rspack/dev-middleware 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/dist/index.js +259 -282
- package/package.json +36 -38
- package/types/index.d.ts +2 -2
- package/types/utils/getPaths.d.ts +4 -4
- package/dist/rslib-runtime.js +0 -29
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ See [below](#other-servers) for examples of use with other servers.
|
|
|
72
72
|
| **[`etag`](#tag)** | `boolean\| "weak"\| "strong"` | `undefined` | Enable or disable etag generation. |
|
|
73
73
|
| **[`lastModified`](#lastmodified)** | `boolean` | `undefined` | Enable or disable `Last-Modified` header. Uses the file system's last modified value. |
|
|
74
74
|
| **[`cacheControl`](#cachecontrol)** | `boolean\|number\|string\|Object` | `undefined` | Enable or disable setting `Cache-Control` response header. |
|
|
75
|
-
| **[`cacheImmutable`](#cacheimmutable)** | `boolean` | `
|
|
75
|
+
| **[`cacheImmutable`](#cacheimmutable)** | `boolean` | `false` | Enable or disable setting `Cache-Control: public, max-age=31536000, immutable` response header for immutable assets. |
|
|
76
76
|
| **[`publicPath`](#publicpath)** | `string` | `undefined` | The public path that the middleware is bound to. |
|
|
77
77
|
| **[`stats`](#stats)** | `boolean\|string\|Object` | `stats` (from a configuration) | Stats options object or preset name. |
|
|
78
78
|
| **[`serverSideRender`](#serversiderender)** | `boolean` | `undefined` | Instructs the module to enable or disable the server-side rendering mode. |
|
|
@@ -208,13 +208,16 @@ Enable or disable setting `Cache-Control` response header.
|
|
|
208
208
|
### cacheImmutable
|
|
209
209
|
|
|
210
210
|
Type: `Boolean`
|
|
211
|
-
Default: `
|
|
211
|
+
Default: `false`
|
|
212
212
|
|
|
213
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`).
|
|
214
|
+
|
|
214
215
|
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.
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
|
|
217
|
+
When omitted, immutable assets fall back to the `cacheControl` option.
|
|
218
|
+
|
|
219
|
+
Set `cacheImmutable: true` to opt into the immutable cache header for hashed assets.
|
|
220
|
+
This takes precedence over the `cacheControl` option only when the asset was defined as immutable and `cacheImmutable` is `true`.
|
|
218
221
|
|
|
219
222
|
### publicPath
|
|
220
223
|
|