= HTTP current age
{c}
<HTTP current age> is a cache's estimate of an <HTTP response>'s age at the time it is considered for reuse. It includes age accumulated before the response reached this cache and the time it has since spent there. The received `Age` field is therefore an input to the calculation, not generally the response's current age at every later instant.<HTTP Caching>[§4.2.3, Calculating Age; §5.1, Age]{ref}
Write $t_q$ for the request time, $t_r$ for response receipt, $t_n$ for now, $D$ for the `Date` value and $a$ for the received `Age` value, all in compatible seconds. The RFC defines <HTTP apparent age> and <HTTP response delay> through
$$
a_{\mathrm{app}}=\max(0,t_r-D),\qquad
\delta=t_r-t_q,\qquad
a_{\mathrm{corr}}=a+\delta.
$$
It permits $a_{\mathrm{corr}}$ as the corrected initial age. For paths with very old caches, it also gives the more conservative choice
$$
a_{\mathrm{init}}=\max(a_{\mathrm{app}},a_{\mathrm{corr}}).
$$
The current age then adds local residence:
$$
a_{\mathrm{now}}=a_{\mathrm{init}}+(t_n-t_r).
$$
The maximum-based choice is an allowed conservative alternative, not the only permitted initial-age calculation.<HTTP Caching>[§4.2.3, apparent_age, response_delay, corrected_age_value and corrected_initial_age alternatives]{ref}
For an own clock example, set $t_q=100$, $t_r=104$, $D=100$, $a=10$ and $t_n=110$. Assume adequately synchronized clocks and use the conservative choice. Apparent age is $4$, response delay is $4$, and corrected age is $10+4=14$. Thus
$$
a_{\mathrm{now}}=\max(4,14)+(110-104)=20.
$$
Using only local residence would have produced six seconds and substantially understated the estimated age.
If the <HTTP freshness lifetime> is $30$ seconds, this response is fresh at the example's current time because $30>20$. At $t_n=120$, its age reaches $30$ and that strict comparison fails. <HTTP freshness> still does not replace the other rules governing cache reuse or <HTTP cache validation>.
The calculation combines local intervals with metadata supplied by other machines. The apparent-age route assumes reasonable clock synchronization, while the delay-corrected route accounts for time spent obtaining the response. Treating `Date` or `Age` as a simple local stopwatch reading would lose those distinctions.<HTTP Caching>[§4.2.3, clock inputs and two age-estimation routes]{ref}
Back to article page