Client Hints are a set of HTTP request header fields that a server can proactively request from a client in order to get information about the device, network, user and agent specific preferences. The server can then determine which resources to send based on the client information.
A server must announce that it supports client hints, using the
Accept-CH header to specify the hints that it is interested in receiving.
When a client that supports client hints receives the
Accept-CH header it can append client hint headers that match the advertised field-values to subsequent requests.
Accept-CH: Width, Downlink
Client hints that determine which resources are sent in responses should "generally" also be included in the affected response's
Vary header. This ensures that a different resource is cached for every different value of the hint header.
Vary: Accept, Width, ECT
You may prefer to omit specifying
Vary or use some other strategy for client hint headers where the value changes a lot, as this effectively makes the resource uncachable (a new cache entry is created for every different value). This applies in particular to network client hints like
RTT. For more information see HTTP Caching > Varying responses.
Device client hints allow a server to choose what information is sent based on the device characteristics including available memory and screen properties. Headers include: