Module static_web_server::compression
source · Available on crate feature
compression only.Expand description
Auto-compression module to compress responses body.
Structs§
- A wrapper around any type that implements
Streamto be compatible with async_compression’sStreambased encoders.
Constants§
- Contains a fixed list of common text-based MIME types in order to apply compression.
Functions§
- Create a wrapping handler that compresses the Body of a
hyper::Responseusinggzip,deflate,brotliorzstdif is specified in theAccept-Encodingheader, addingcontent-encoding: <coding>to the Response’sHeaderMap. It also provides the ability to apply compression for text-based MIME types only. - brotli
compression-brotli - Given an optional existing encoding header, appends to the existing or creates a new one.
- deflate
compression-deflate - Try to get the prefered
content-encodingvia theaccept-encodingheader. - gzip
compression-gzip - zstd
compression-zstd