IPTV AUSTRALIA · 1 MONTH AUD $11.99 TOTALInstall your player. Request a one-day trial ↗

Help · IPTV Australia

HTTP Vary and response selection

A URL is not always the complete identity of a reusable HTTP response. Vary identifies request-header fields that influenced response selection. A cache uses them when deciding whether one stored response can satisfy a later request. Record the relevant request fields whenever comparing two apparent copies.

One address, multiple representations

A server might send compressed text to a client that accepts gzip and uncompressed text to another client. Vary: Accept-Encoding tells a cache that the request's encoding preference matters when selecting a stored response. Both responses can belong to the same URL without being byte-for-byte identical.

The comparison is not an arbitrary browser-name rule. It concerns the nominated request fields and their defined matching behaviour. If a field is absent in one request, that absence is meaningful when the cache compares variants.

A two-client example

Client A asks for an example playlist while advertising gzip support. Client B asks for the same address without that support. If the publisher varies the representation accordingly, a cache must avoid giving B a stored encoded response that does not fit B's request simply because the URL matches.

A public diagnostic that compares only address and status could miss this distinction. Include relevant request headers, Content-Encoding and Vary when comparing the two results. The content can be semantically equivalent after decoding while its transferred representation differs.

Why inconsistent cache behaviour needs context

Vary can also participate in dynamically selected CORS responses when the allowed origin depends on the request origin. The publisher must coordinate selection and caching so that a response intended for one request context is not reused incorrectly for another. A viewer should report that pattern rather than disabling browser security.

A Vary value of an asterisk has special matching implications; it is not a useful catch-all spelling for every ordinary variant. Configuration should reflect actual response-selection inputs. Adding random fields can fragment a cache unnecessarily without solving the underlying delivery problem.

Questions about this guide

Can the same URL have two valid cached representations?

Yes, when request-dependent selection and cache rules permit it.

Does Vary control which audio language a player chooses?

Not directly. It describes HTTP response selection; media track selection is a separate layer.

Sources and further reading

Get your setup right from the start.

Tell us your device and player. We’ll help you take the next step with a clear plan enquiry or trial request.

Talk to IPTV Australia ↗