Skip to main content

apply_gzip

Function apply_gzip 

Source
pub fn apply_gzip(request: &Request, response: &mut Response)
Expand description

If the client accepts gzip and the response body is compressible text of at least MIN_COMPRESS_SIZE bytes, compress every content range in-place and add Content-Encoding: gzip; also appends Accept-Encoding to the Vary header. A body that gzip doesn’t make smaller (already compressed or random data) is left as it was, and so is a response that already has a Content-Encoding (e.g. a backend that compressed it).