Module compression

Module compression 

Source
Expand description

Compression utilities for HTTP content encoding.

This module provides support for automatic compression and decompression of HTTP responses using various encoding formats.

Enums§

ContentEncoding
Supported content encodings for streaming decompression.

Functions§

add_accept_encoding
Insert an Accept-Encoding header (br, zstd, gzip) if not already present.
add_content_encoding
Add a Content-Encoding header for outgoing requests that will be compressed.
compress_payload
Compress a byte payload using the specified encoding.
decompress_body
Decompress a response body based on the content encoding.
decompress_stream
Create a buffered reader with decompression support for streaming.
detect_encoding
Backwards-compatible helper that returns the first encoding in the chain or identity when none.
detect_encodings
Detect the response Content-Encoding header and return the ordered chain of encodings.
detect_request_compression_preference
Detect the most efficient request compression supported by the server.