Age Header
A response header added by caches indicating how long (in seconds) the response has been stored. The remaining freshness is calculated as: max-age - Age. When Age equals or exceeds max-age, the content is stale.
Full Explanation
The Age header is a response header added by caches (CDN edge servers, reverse proxies) that tells you how many seconds a response has been sitting in cache since it was fetched from the origin. It is never set by the origin server itself. When you see Age: 120, it means the cached copy was stored 120 seconds ago.
You calculate remaining freshness as max-age - Age. If your response has Cache-Control: max-age=3600 and Age: 3500, the content has only 100 seconds of freshness left. Once Age equals or exceeds max-age, the content is considered stale. A cache may still serve stale content while revalidating in the background (if stale-while-revalidate is set), but it knows revalidation is needed.
Age is a great debugging tool. If you keep seeing Age: 0 on every request, you are getting cache misses every time, which means something is wrong with your caching setup. If Age values are consistently close to max-age, content is being served right before expiration. A healthy cache shows a range of Age values across requests.
# Check Age header with curl
$ curl -sI https://cdn.example.com/style.css | grep -i 'age\|cache-control'
Cache-Control: max-age=86400
Age: 7243
# This response has been in cache for ~2 hours
# Remaining freshness: 86400 - 7243 = 79157 seconds (~22 hours)
# Age: 0 means fresh from origin (cache miss or just revalidated)
$ curl -sI https://cdn.example.com/new-page.html | grep -i 'age'
Age: 0
Examples
When debugging CDN caching, combine Age with other cache-related headers to get the full picture.
# Full cache debugging request
$ curl -sI https://cdn.example.com/api/products | grep -iE 'age|cache|x-cache|cf-cache'
Cache-Control: public, max-age=300
Age: 45
X-Cache: HIT
# Content was cached 45 seconds ago, still fresh for 255 seconds
# X-Cache: HIT confirms it was served from cache
Frequently Asked Questions
A response header added by caches indicating how long (in seconds) the response has been stored. The remaining freshness is calculated as: max-age - Age. When Age equals or exceeds max-age, the content is stale.
When debugging CDN caching, combine Age with other cache-related headers to get the full picture.
# Full cache debugging request
$ curl -sI https://cdn.example.com/api/products | grep -iE 'age|cache|x-cache|cf-cache'
Cache-Control: public, max-age=300
Age: 45
X-Cache: HIT
# Content was cached 45 seconds ago, still fresh for 255 seconds
# X-Cache: HIT confirms it was served from cache
Related CDN concepts include:
- max-age — Specifies the maximum time in seconds that a response is considered fresh. Applies to all …