Table of Content
- Browser Compatibility
- How to modify Critical-CH header The Critical-CH header is a server response header used in HTTPs that provides the functionality to enable Client Hints for subsequent requests made by the user's browser to the server. This allows clients to reveal details about their capabilities or preferences to the server so the server can provide an optimized user experience by customizing the response based on the data supplied by the hints.
Critical-CH: <directive> [, <directive>]*
The directives for Critical-CH header are key-value pairs separated by commas in the structure
<value> where each key is a client hint request eg.
An example of how to use the Critical-CH header is:
This will inform the browser to send the
device-memory hint in its subsequent requests, allowing the server to make optimizations based on the device's memory capabilities.
How to modify Critical-CH header
The ModHeader Chrome extension is useful for modifying HTTP request and response headers. It can be used to modify the Critical-CH header as follows:
- Install the ModHeader extension in your Chrome browser.
- Click the ModHeader icon in the toolbar to open the extension.
- In the 'Response headers' section, click 'Add response header'.
- Input 'Critical-CH' in the 'Name' field and your directives in the 'Value' field. For example, write
device-memoryif you want to simulate how the header would operate for a device with specific memory.
- Now, each time you make an HTTP request from your browser, the response will include the modified Critical-CH header.
Modifying the header is helpful for debugging. You can test how your server responds to different client hint configurations without having to rely on changing client settings.