Accept-CH Header

Table of Content

The Accept-CH header is used by a server to indicate users' device and preference information that it wants from the client to better render and optimize the user experience. Also known as Client Hints, the Accept-CH method helps servers make intelligent adjustments based on user-specific data, reducing latency and enhancing user engagement.

Syntax

Accept-CH: <directive>

Where <directive> is one of the directives defined below.

Directives

  1. DPR
  2. Viewport-Width
  3. Width These are a few examples of the directives supported by the Accept-CH header. DPR stands for Device Pixel Ratio, Viewport-Width represents the layout viewport width, and Width is the requested resource's expected width in CSS pixel.

Examples

To request Viewport-Width and Width information from the client, the server uses the following Accept-CH header.

Accept-CH: Viewport-Width, Width

Browser Compatibility

Browser Compatibility
Chrome Supported
Firefox Not Supported
Safari Not Supported
Opera Supported
Edge Supported

How to modify Accept-CH header

The ModHeader Chrome extension provides a graphical tool for modifying request headers. Here's how to modify the Accept-CH header using ModHeader:

  1. Add the ModHeader extension to your Chrome.
  2. Click on the ModHeader icon in your Chrome toolbar to open it.
  3. On the left panel, click on the '+' button to create a new header.
  4. In the 'Name' field, enter Accept-CH.
  5. In the 'Value' field, enter the directive (e.g., Viewport-Width, Width).
  6. Hit 'Enter' to save.

The extension will ensure any subsequent HTTP requests initiated from your Chrome will include the modified Accept-CH header. Its real value lies in its ability to allow for testing and debugging of server responses based on different client conditions.