merge_vary

Function merge_vary 

Source
pub fn merge_vary(headers: &mut HeaderMap, token: &str)
Expand description

Merge one token into a response’s Vary header (DW-027): appended to the existing comma-separated list when not already present (case-insensitive), created otherwise. RFC 9110 permits MULTIPLE Vary field lines; every line is folded into the membership check and the merged value, and the result replaces the set with one line — reading only the first line would drop the later lines’ tokens and corrupt cache keys for upstreams that split their Vary. Correct Vary is what keeps a shared cache from serving a compressed (or origin-specific) response to a client that could not have received it.