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 throughIt permits as the corrected initial age. For paths with very old caches, it also gives the more conservative choiceThe current age then adds local residence:The maximum-based choice is an allowed conservative alternative, not the only permitted initial-age calculation.[ref]HTTP Caching. §4.2.3, apparent_age, response_delay, corrected_age_value and corrected_initial_age alternatives
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 . ThusUsing 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] New to topics? Read the docs here!