Expand description
Response compression using gzip/deflate (via flate2).
Compression is applied at the hyper response layer.
This module provides the compress_body helper function
and a middleware that sets the Vary header.
Structs§
- Compression
Config - Compression configuration.
- Compression
Middleware - Middleware that compresses response bodies with gzip when the client
supports it (via
Accept-Encoding: gzip) and the response exceedsmin_sizebytes.
Functions§
- compress_
gzip - Compress a byte buffer using gzip at the given compression level (0-9).