Description
Fingerprint explicit Vary request field occurrence arrays, distinguishing absent from empty fields and returning null for Vary star; reusable means no star only, not full cache reuse authorization.
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.
Fingerprint explicit Vary request field occurrence arrays, distinguishing absent from empty fields and returning null for Vary star; reusable means no star only, not full cache reuse authorization.
When to use this tool
Use this tool to fingerprint explicit Vary request field occurrence arrays, distinguishing absent from empty fields and returning null for Vary star; reusable means no star only, not full cache reuse authorization.
How to use the tool and how it works
- Enter varyNames, requestHeadersJson 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.fingerprint, result.reusable. Interpret signs, units, ordering and null values using the rules below.
Lowercase and deduplicate Vary names, then sort them. For each name collect exact request field values in occurrence order and JSON-encode [name,values] records. An absent field has [], an empty occurrence has [""]. A star returns fingerprint = null and reusable = false.1, 2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| varyNames | Explicit Vary field-name strings, case-insensitive; star disables this fingerprint’s reuse flag. | Dense list of at most 128 strings, each at most 8,192 UTF-16 code units. |
| requestHeadersJson | JSON array of {name,value} request-header string occurrences. Names use HTTP token syntax; values use the supported single-byte-compatible subset without CR/LF. | 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.
{
"requestHeadersJson": [
{
"name": "X-A",
"value": "one"
},
{
"name": "x-a",
"value": "two"
},
{
"name": "Set-Cookie",
"value": "a=1"
}
]
} | Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.fingerprint | Literal JSON request-field occurrence fingerprint, or null for Vary star. |
| result.reusable | Whether Vary star is absent; this flag alone is not full cache reuse permission. |
{
"input": {
"varyNames": [
"X-A"
],
"requestHeadersJson": "[{\"name\":\"X-A\",\"value\":\"one\"},{\"name\":\"x-a\",\"value\":\"two\"},{\"name\":\"Set-Cookie\",\"value\":\"a=1\"}]"
},
"output": {
"result": {
"fingerprint": "[[\"x-a\",[\"one\",\"two\"]]]",
"reusable": true
}
}
} Limitations and assumptions
- reusable means only that no star was supplied. The fingerprint is a literal comparison record, not a cryptographic hash or full authorization to reuse a cached response.
- 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: Vary Request Value Fingerprint — 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.
- Vary Name Set Audit
Audit explicit Vary field-name set duplicates and mixed wildcard use under HTTP case-insensitive names; no header-line parser or policy repair.