Skip to main content

Module encoding

Module encoding 

Source
Expand description

Content-Encoding support

Supports gzip, deflate and zstd. Large chunks are encoded and decoded on the blocking thread pool, smaller ones on the current thread.

§Memory

Each compressed response keeps its encoder until the body ends: about 1.5MiB for a zstd body of unknown or large size, less for small bodies of known size, and about 370KiB for gzip and deflate. There is no global limit, many concurrent streaming responses can use a lot of memory. Responses that gain little from compression can be sent with ContentEncoding::Identity through the web::BodyEncoding trait.

Structs§

Decoder
Payload stream decoder.
Encoder
Response body encoder.