Description
Compute RFC 9111 corrected initial cache age from explicit same-unit timestamps and Age value; no actual network observation or clock synchronization assumed.
HTTP caches distinguish storage policy, freshness and validation. Age and freshness lifetime are durations in seconds; an entity tag is an opaque validator that can be marked weak. Vary identifies request fields relevant to representation selection. A focused arithmetic or token check alone does not decide whether a stored response may be reused.
Compute RFC 9111 corrected initial cache age from explicit same-unit timestamps and Age value; no actual network observation or clock synchronization assumed.
When to use this tool
Use this tool to compute RFC 9111 corrected initial cache age from explicit same-unit timestamps and Age value; no actual network observation or clock synchronization assumed.
How to use the tool and how it works
- Enter requestTime, responseTime, dateValue, ageValue using the input definitions below.
- Run the operation. Resolve malformed-input errors before interpreting the result.
- Read result.apparentAge, result.correctedAgeValue, result.correctedInitialAge. Interpret signs, units, ordering and null values using the rules below.
Require responseTime≥requestTime and nonnegative ageValue. apparentAge = max(0,responseTime−dateValue); correctedAgeValue = ageValue+responseTime−requestTime; correctedInitialAge is their maximum.1, 2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| requestTime | Request-send timestamp in seconds on the common clock origin. | Finite number satisfying the stated comparisons. |
| responseTime | Response-receive timestamp, at least requestTime, in the same seconds scale. | Finite number satisfying the stated comparisons. |
| dateValue | Already parsed Date timestamp in the same seconds scale. | Finite number satisfying the stated comparisons. |
| ageValue | Nonnegative supplied Age duration in seconds. | Finite number satisfying the stated comparisons. |
| Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.apparentAge | max(0,responseTime−dateValue), in seconds. |
| result.correctedAgeValue | ageValue+responseTime−requestTime, in seconds. |
| result.correctedInitialAge | Maximum of apparentAge and correctedAgeValue, in seconds. |
{
"input": {
"requestTime": 10,
"responseTime": 12,
"dateValue": 5,
"ageValue": 3
},
"output": {
"result": {
"apparentAge": 7,
"correctedAgeValue": 5,
"correctedInitialAge": 7
}
}
} Limitations and assumptions
- All timestamps and Age durations must use seconds for HTTP semantics, with timestamps on a common clock origin. The tool does not parse HTTP dates or correct unsynchronized clocks.
- No HTTP exchange, cache store, clock or server is accessed. Header/directive occurrences and timestamps are supplied explicitly. Durations use seconds for HTTP semantics; timestamps must share an origin and unit.
- Every declared top-level input is required and unknown fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and within the absolute safe-integer magnitude; exact larger integers use decimal text. Source positions are zero-based UTF-16 offsets and span ends are exclusive unless a different convention is explicitly stated.
Alternative or Complementary methods
Combine these focused results with the request/response caching rules applicable to the actual exchange. Preserve field occurrences and distinguish freshness calculations, validator comparison and complete cache-reuse authorization.
References
-
RFC 9111: HTTP Caching — RFC Editor
-
Tool behavior and example: Cache Corrected Initial Age — tool.io
Similar or alternative tools
- Cache Age Saturation Formatter
Format a nonnegative exact cache Age integer with RFC delta-seconds overflow saturation at 2^31; does not read response timing.
- Cache Directive Extension Inventory
Inventory explicit cache directive names outside a caller-provided known-name bank; no hardcoded current registry or automatic extension semantics.