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.[ref]
Write for the request time, for response receipt, for now, for the Date value and for the received Age value, all in compatible seconds. The RFC defines HTTP apparent age and HTTP response delay through
It permits as the corrected initial age. For paths with very old caches, it also gives the more conservative choice
The current age then adds local residence:
The maximum-based choice is an allowed conservative alternative, not the only permitted initial-age calculation.[ref]
For an own clock example, set , , , and . Assume adequately synchronized clocks and use the conservative choice. Apparent age is , response delay is , and corrected age is . Thus
Using only local residence would have produced six seconds and substantially understated the estimated age.
If the HTTP freshness lifetime is seconds, this response is fresh at the example's current time because . At , its age reaches 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.[ref]
In the HTTP current age calculation, HTTP response delay is the interval between the cache's request time and the time it receives the corresponding HTTP response:
The interval corrects the age information carried in the response for time spent obtaining it. It is one input to cache-age estimation.[ref]
For an own example, a cache initiates a request at local time seconds and receives the response at . Its response delay is seconds. If the response carries Age: 12, the RFC's delay-corrected value is
After another four seconds of local residence, using that corrected initial age would give seconds of current age.[ref]
This interval does not isolate server computation. Transport, waiting and response handling can all contribute; a single elapsed interval does not reveal their separate amounts. Likewise, the received Date value comes from response metadata rather than defining either local endpoint of this subtraction.
The RFC permits the corrected age value as the corrected initial age. It also gives a conservative alternative that takes the maximum of that value and HTTP apparent age, particularly for paths involving old caches that might not supply appropriate Age information. The example uses the delay-corrected route explicitly instead of silently assuming both routes always agree.[ref]
A correct elapsed-time calculation matters because HTTP freshness compares the resulting age with an HTTP freshness lifetime. Treating a received response as age zero simply because it has just reached the local cache would discard both the received age estimate and the acquisition interval.
HTTP apparent age estimates the age of an HTTP response at receipt by comparing its Date value with the receiving cache's clock. With receipt time and date value expressed in compatible seconds,
The nonnegative clamp prevents a negative age when the date appears to lie in the receiver's future. The RFC describes this estimation route as relying on reasonable clock synchronization.[ref]
For example, receipt time and date value give an apparent age of six seconds. With receipt time and date value , the result is instead
This zero does not establish that the representation was generated at the instant of receipt. A disagreement between clocks can conceal age in this comparison.
Another estimation route uses the received Age value and HTTP response delay. Suppose a request starts at , its response arrives at , the date value is and the received age is ten seconds. The apparent age is zero, while the delay-corrected value is . The RFC's conservative maximum-based initial estimate therefore gives fourteen seconds rather than zero.[ref]
After six more seconds in this cache, that initial estimate gives HTTP current age . Apparent age itself is the receipt-time estimate; adding local residence belongs to the later current-age calculation. Keeping those stages distinct avoids adding the wrong interval or treating the original estimate as a permanently current value.
The result feeds HTTP freshness rather than replacing the full reuse decision. A small apparent age does not override cache controls, validate the current origin state or make every stored response eligible for reuse. It is useful precisely as one defined estimate with explicit inputs and assumptions.

Articles by others on the same topic (0)

There are currently no matching articles.