Table of Content
- Browser Compatibility
- How to modify Accept-CH-Lifetime header The Accept-CH-Lifetime Header, originally designed around the Client Hints (CH) mechanism in web browsers, is deployed to guide how long the client should remember the provided Client Hints set by a host. Generally, hosts set the Client Hints and the configurations are stored for future requests. The purpose of this header is to limit the time such configurations are stored, improving browser performance and elevating user privacy.
The syntax of Accept-CH-Lifetime header is as follows:
<seconds> is the number of seconds the client should remember site settings for Client Hints.
The only directive for the Accept-CH-Lifetime header is the time value. This is expressed in seconds and depicts the time duration for which the client will remember the list of Client Hints set by the host.
If you want the browser client to remember the Client Hints for a day:
To remember the settings for a week:
How to modify Accept-CH-Lifetime header
ModHeader is a browser extension only compatible with Chrome that allows you to modify both request and response headers in Chrome.
Follow the below steps to modify Accept-CH-Lifetime Header:
- Add the ModHeader extension to Chrome.
- After clicking the ModHeader icon, a form will appear.
- Select 'Response headers' from the drop-down list.
- In the input field that appears, type 'Accept-CH-Lifetime' in the name field.
- In the adjacent value field, input the duration in seconds according to your requirements.
- Save the settings.
For example, to remember the settings for one hour:
Name: Accept-CH-Lifetime Value: 3600
This kind of modification is useful when testing Client Hints behavior for different durations or testing the performance of a web application with different Client Hints settings.