🎉 Requestly joins BrowserStack to build the future of application testing. Read more

HTTP Headers

Age

HTTP Header

The HTTP Age response header indicates the duration in seconds that an object has been stored in a proxy cache.

The value of this header is typically close to zero.
If the value is 0, it suggests that the object was likely retrieved directly from the origin server; otherwise, the value is usually calculated as the difference between the proxy’s current date and the Date header included in the HTTP response.

Syntax

Age: <delta-seconds>

Directives

<delta-seconds>

A non-negative integer that specifies the duration, in seconds, that an object remains in a proxy cache before it expires and needs to be refreshed or re-fetched from the origin server.

Example

http
Age: 24

How to Modify Header using Requestly

Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Age header. This is especially useful for testing how your application handles cached content or response freshness during development or debugging. Steps to Modify the Age Header:

  1. Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
  2. Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
  3. Add a new header modification:
    • Under “Action”, select “Add” or “Override”.
    • In the “Header Name” field, enter Age.
    • In the “Header Value” field, enter your preferred age value (e.g., 120).
  4. Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/*).
  5. Save the rule.

Once set up, Requestly will inject the Age header with your specified value into all matching requests, allowing you to test how your application interprets cache age and controls content freshness.