Table of Content
- Browser Compatibility
- How to modify Age header The Age header in HTTP responses represents the period of time, in seconds, since the response was generated by the origin server. This is typically used by caching mechanisms to determine the freshness of the response and consequently whether to deliver a cached version or seek a new one.
The Age header follows a straightforward syntax:
seconds can be any integer number representing the period of the response life in seconds.
The Age header has no specific directives, as it only accepts an integer value indicating a time span in seconds.
Examples of the Age header in use might look like this:
In the aforementioned example, a caching proxy or a client would understand that the response was created one hour ago by the origin server.
How to modify Age header
ModHeader is a Chrome extension that can modify request and response headers. To modify the Age header with ModHeader, follow these steps:
- Open ModHeader.
- Select 'Response headers.'
- Under 'Header', write 'Age.'
- Under 'Value', input the desired number of seconds.
This setup adds the Age header to responses, thus simulating that the response is older than it really is. This can be useful for testing caching behavior under various circumstances.