Compressor
This behaviour checks if the request comes with an Accept-Encoding
header set to gzip, and in this case it compresses the content.
(A Content-Encoding: gzip will show up in the reponse).
The gzip value in the config can have the following values.
chunked: will use chunkedTransfer-Encodingand will not allow theContent-Lengthheader in the response (TODO: we would need to check how this works when using HTTP2).knownlength: will prevent streaming, it will buffer all the response while compressing it to know theContent-Lengthof the full response.flex: (not implemented yet), will use buffered response, that will produce a response withContent-LengthifFlushis not called by any other part of the behaviour, orchunkedif flush is called to send data out.
{
"name": "compressor",
"config": {
"gzip": "always"
}
}