Age Header
Table of Content
- Syntax
- Directives
- Examples
- 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.
Syntax
The Age header follows a straightforward syntax:
Age: seconds
Here, seconds
can be any integer number representing the period of the response life in seconds.
Directives
The Age header has no specific directives, as it only accepts an integer value indicating a time span in seconds.
Examples
Examples of the Age header in use might look like this:
Age: 3600
In the aforementioned example, a caching proxy or a client would understand that the response was created one hour ago by the origin server.
Browser Compatibility
Browser | Compatibility |
---|---|
Chrome | Supported |
Firefox | Supported |
Safari | Supported |
Opera | Supported |
Edge | Supported |
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.