Age
The HTTP Age response header indicates the number of seconds a response has resided in a proxy or CDN cache since the origin server generated the response.
Usage
Caches insert the Age header to communicate how long a stored response has been sitting in the cache. The value represents the difference between the current time and the Date header of the original response, accounting for transit delays and time spent in intermediate caches along the path.
An Age value of 0 means the response was fetched
directly from the origin or arrived moments ago. Higher
values signal the response has been served from a
cache, and the number indicates how stale the copy
has become relative to the original generation time.
Cache-Control directives such as
max-age and s-maxage set the freshness lifetime.
The Age value is compared against the lifetime to
determine whether the stored response is still fresh.
When Age exceeds max-age, the response is
considered stale and triggers revalidation or a fresh
fetch depending on the caching policy in effect.
Values
delta-seconds
The value is a non-negative integer representing the age of the response in seconds. Fractional seconds are not supported.
Age: <delta-seconds>
Example
A response served from a CDN edge cache 15 seconds
after the origin generated the resource. The origin
set a max-age of 600 seconds, so the response
remains fresh for another 585 seconds.
Age: 15
Cache-Control: max-age=600
A response already in the cache for ten minutes. If the freshness lifetime is shorter than 600 seconds, the response is stale and the next request triggers revalidation.
Age: 600
Takeaway
The Age header reports how many seconds a cached response has spent in storage since the origin created the resource. Comparing the age against the freshness lifetime defined by Cache-Control determines whether the cached copy is still usable.