Doc middleware compress content type
This commit is contained in:
parent
7c7ca7ef2b
commit
e5c6b0d4ea
2 changed files with 6 additions and 0 deletions
|
@ -64,6 +64,9 @@ http:
|
||||||
* The `Accept-Encoding` request header contains `gzip`.
|
* The `Accept-Encoding` request header contains `gzip`.
|
||||||
* The response is not already compressed, i.e. the `Content-Encoding` response header is not already set.
|
* The response is not already compressed, i.e. the `Content-Encoding` response header is not already set.
|
||||||
|
|
||||||
|
If Content-Type header is not defined, or empty, the compress middleware will automatically [detect](https://mimesniff.spec.whatwg.org/) a content type.
|
||||||
|
It will also set accordingly the `Content-Type` header with the detected MIME type.
|
||||||
|
|
||||||
## Configuration Options
|
## Configuration Options
|
||||||
|
|
||||||
### `excludedContentTypes`
|
### `excludedContentTypes`
|
||||||
|
|
|
@ -22,6 +22,9 @@ This middleware exists to enable the correct behavior until at least the default
|
||||||
Therefore, given the default value of the `autoDetect` option (false),
|
Therefore, given the default value of the `autoDetect` option (false),
|
||||||
simply enabling this middleware for a router switches the router's behavior.
|
simply enabling this middleware for a router switches the router's behavior.
|
||||||
|
|
||||||
|
The scope of the Content-Type middleware is the MIME type detection done by the core of Traefik (the server part).
|
||||||
|
Therefore, it has no effect against any other `Content-Type` header modifications (e.g.: in another middleware such as compress).
|
||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker"
|
||||||
|
|
Loading…
Add table
Reference in a new issue