Search Documentation

ch Client Hints

Note: ch cannot be set as a Source’s default parameter, due to the way it interacts with imgix’s caching infrastructure.

The ch parameter opts in specific images to use Client Hints, which provide automatic resource selection using browser headers. imgix currently supports three hints, which override or change their respective imgix parameters:

  • Width overrides the imgix w parameter
  • DPR overrides the imgix dpr parameter
  • Save-Data reduces image quality to q=45 and may change the output format of the image

You can use multiple Client Hints—values should be comma-separated. If the browser does not support Client Hints, the other values present in the URL will be used. For example, the URL below will take advantage of the Width and DPR Client Hints if present and fall back to an image that’s 400 device-independent pixels wide at 2 DPR if the browser doesn’t support them:

https://assets.imgix.net/unsplash/bear.jpg?ch=Width,DPR&w=400&dpr=2

Note: All browsers that support Save-Data will send the header, regardless of whether or not the Client Hint meta tag is present. However, if you want to use the other Client Hints, you will need to include the following in your site’s <meta> tags to ensure that the headers are sent to the browser:

<meta http-equiv="Accept-CH" content="Width,DPR">

For more information and use cases, please see the following: