pub fn decide(
policy: &Compression,
types: &CompiledContentTypeFilter,
status: StatusCode,
headers: &HeaderMap,
body_size: Option<u64>,
accept_encoding: Option<&str>,
) -> Option<CompressionPlan>Expand description
Decide whether THIS response gets compressed under the policy
(DW-027): status, existing encoding, known size, content type, and
negotiation all have to line up. None = pass through (the caller
still adds Vary: Accept-Encoding for cache correctness).
types is the policy’s snapshot-compiled content-type filter (see
crate::snapshot::RouteTable::compression_types); body_size is
the response body’s exact size when known (size_hint().exact() —
exact for the gateway’s fully-buffered bodies) so min_size gates
bodies that carry no Content-Length header too (respond-action
and redirect bodies). None = length unknown (streaming).