Available on crate feature compression only.
Expand description
Auto-compression module to compress responses body.
A wrapper around any type that implements
Stream to be
compatible with async_compression’s
Stream based encoders.
Create a wrapping handler that compresses the Body of a
Response
using
gzip,
deflate,
brotli or
zstd if is specified in the
Accept-Encoding header, adding
content-encoding: <coding> to the Response’s
HeaderMap
It also provides the ability to apply compression for text-based MIME types only.
Create a wrapping handler that compresses the Body of a
Response
using brotli, adding
content-encoding: br to the Response’s
HeaderMapGiven an optional existing encoding header, appends to the existing or creates a new one.
Create a wrapping handler that compresses the Body of a
Response
using deflate, adding
content-encoding: deflate to the Response’s
HeaderMapTry to get the prefered content-encoding via the accept-encoding header.
Create a wrapping handler that compresses the Body of a
Response
using gzip, adding
content-encoding: gzip to the Response’s
HeaderMapCreate a wrapping handler that compresses the Body of a
Response
using zstd, adding
content-encoding: zstd to the Response’s
HeaderMap