Description
Audit conflicting explicit Cache-Control directive occurrences under case-insensitive names, distinguishing bare/null from empty values; no conflict-resolution policy.
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.
Audit conflicting explicit Cache-Control directive occurrences under case-insensitive names, distinguishing bare/null from empty values; no conflict-resolution policy.
When to use this tool
Use this tool to audit conflicting explicit Cache-Control directive occurrences under case-insensitive names, distinguishing bare/null from empty values; no conflict-resolution policy.
How to use the tool and how it works
- Enter directivesJson 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.conflicts. Interpret signs, units, ordering and null values using the rules below.
Group normalized directive names and keep groups with more than one distinct exact serialized value. Return group names and all occurrence indexes.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. |
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": "MAX-AGE",
"value": "6"
}
]
} | Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.conflicts | Normalized directive groups with distinct raw values and occurrence indexes. |
{
"input": {
"directivesJson": "[{\"name\":\"max-age\",\"value\":\"5\"},{\"name\":\"MAX-AGE\",\"value\":\"6\"}]"
},
"output": {
"result": {
"conflicts": [
{
"key": "max-age",
"indexes": [
0,
1
]
}
]
}
}
} Limitations and assumptions
- A bare null directive, an empty string and other string spellings remain distinct; no conflict-resolution precedence is chosen.
- 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 Occurrence Conflict Audit — tool.io
Similar or alternative tools
- Cache Directive Extension Inventory
Inventory explicit cache directive names outside a caller-provided known-name bank; no hardcoded current registry or automatic extension semantics.
- 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.