Skip to main content

Module compression

Module compression 

Source
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§

CompressionConfig
Compression configuration.
CompressionMiddleware
Middleware that compresses response bodies with gzip when the client supports it (via Accept-Encoding: gzip) and the response exceeds min_size bytes.

Functions§

compress_gzip
Compress a byte buffer using gzip at the given compression level (0-9).