How are client hints really useful for web performance

Click for: original source

Client Hints are HTTP request header fields that a server can request from a client in order to get information about the client’s device, network, etc. The server can then determine the type of data to be displayed according to the client information received. By Hargunbeer Singh.

A server must tell the client that it supports client hints, this can be done using the Accept-CH header. 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.

Client hints can also be specified in HTML using the <meta> tag with http-equiv attribute.

The client hints which determine which resources are sent in responses should be included in the Vary header. This ensures that a different resource is cached for every different value of the hint header. Usually, client hints like Width and DPR are specified in the Vary header. Interesting read!

[Read More]

Tags apis devops software web-development performance