Description
Inventory explicit cache directive names outside a caller-provided known-name bank; no hardcoded current registry or automatic extension semantics.
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.
Inventory explicit cache directive names outside a caller-provided known-name bank; no hardcoded current registry or automatic extension semantics.
When to use this tool
Use this tool to inventory explicit cache directive names outside a caller-provided known-name bank; no hardcoded current registry or automatic extension semantics.
How to use the tool and how it works
- Enter directivesJson, knownNames using the input definitions below. Serialize the JSON text fields in the decoded shape shown below.
- Run the operation. Resolve malformed-input errors before interpreting the result.
- Read result.extensions. Interpret signs, units, ordering and null values using the rules below.
Compare each normalized directive name against the caller’s case-insensitive known-name list and return every unmatched occurrence with its original index and value.1, 2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| directivesJson | JSON array of {name,value} directives: HTTP token name and a string value or null for a bare directive. Names are normalized to lowercase. | Text, at most 8,192 UTF-16 code units; the stated grammar and narrower limits also apply. |
| knownNames | Caller-supplied known directive names, compared case-insensitively. | Dense list of at most 128 strings, each at most 8,192 UTF-16 code units. |
These decoded examples show the structure of the JSON text fields. Supply each as its corresponding serialized JSON string.
{
"directivesJson": [
{
"name": "max-age",
"value": "5"
},
{
"name": "custom",
"value": null
}
]
} | Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.extensions | Unknown-to-bank directive occurrences with original index. |
{
"input": {
"directivesJson": "[{\"name\":\"max-age\",\"value\":\"5\"},{\"name\":\"custom\",\"value\":null}]",
"knownNames": [
"max-age"
]
},
"output": {
"result": {
"extensions": [
{
"name": "custom",
"value": null,
"index": 1
}
]
}
}
} Limitations and assumptions
- The known-name bank is supplied rather than a built-in current registry; unknown extensions receive no inferred semantics.
- 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 Directive Extension Inventory — tool.io
Similar or alternative tools
- Cache Directive Numeric Value Audit
Audit unsigned decimal syntax of caller-declared numeric cache directives without coercing or accepting signs, quotes or defaults; values remain raw strings.
- Cache Directive Occurrence Conflict Audit
Audit conflicting explicit Cache-Control directive occurrences under case-insensitive names, distinguishing bare/null from empty values; no conflict-resolution policy.