HTTP Age Delta Seconds Parser

Parse HTTP Age delta-seconds as unsigned decimal; retain exact spelling-normalized value and conservatively saturate numeric age at 2^31 seconds.

Description

Parse HTTP Age delta-seconds as unsigned decimal; retain exact spelling-normalized value and conservatively saturate numeric age at 2^31 seconds.

The HTTP Age field carries a non-negative age estimate in seconds. Delta-seconds uses decimal digits, and RFC 9111 specifies conservative overflow handling. This parser preserves the exact decimal value as text while exposing a numeric value capped at 2^31 seconds.1

When to use this tool

Parse HTTP Age delta-seconds as unsigned decimal; retain exact spelling-normalized value and conservatively saturate numeric age at 2^31 seconds.

  • Prepare the supplied value fields for this operation.
  • Compare the complete example with the representation used by your own input before carrying the result into another step.

How to use the tool and how it works

  1. Enter the Age field value as unsigned decimal text, such as "00042".
  2. Run the parser. Correct malformed input before interpreting the result.
  3. Read canonicalDecimal for the exact value without redundant leading zeros, conservativeAgeSeconds for the bounded number of seconds, and saturated to see whether the input exceeded the cap.

Require unsigned decimal digits, canonicalize leading zeros and parse the exact integer. Return conservativeAgeSeconds=min(value,2147483648) and saturated only when the input exceeds that limit.2

Input fieldMeaning and representationAccepted input
valueThe Age field value in seconds, supplied as unsigned decimal text.Text; at most 8,192 UTF-16 code units, subject to the grammar above
Output fieldInterpretation
resultObject containing the named outputs below.
result.canonicalDecimalExact non-negative integer as decimal text, with redundant leading zeros removed.
result.conservativeAgeSecondsNumeric age in seconds, capped at 2,147,483,648.
result.saturatedTrue only when the exact input exceeds 2,147,483,648; false when equal to or below the cap.
json
{
  "input": {
    "value": "00042"
  },
  "output": {
    "result": {
      "canonicalDecimal": "42",
      "conservativeAgeSeconds": 42,
      "saturated": false
    }
  }
}

Limitations and assumptions

  • No response date, cache residence calculation or freshness decision is performed. The original large canonical value remains a string.
  • Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
  • String lists have at most 128 entries of at most 128 code units; matrices have at most 128 rows and columns. Larger numeric lists and parsed JSON have separate bounded budgets. Nonfinite results and excessively large serialized outputs are rejected.
  • Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.

Alternative or Complementary methods

Use a complete HTTP cache model for freshness and age calculations. A parsed field value and conservative numeric representation are inputs to that model, rather than a freshness decision.

References

  1. RFC 9111: Delta Seconds (§1.2.2), with Age defined in §5.1 — RFC Editor

  2. Tool behavior and example: HTTP Age Delta Seconds Parser — tool.io

Similar or alternative tools

  • accept language parser

    Accept-Language expresses preferred language ranges with optional weights.

  • accept parser

    Accept lists media ranges and preference weights for representation negotiation.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies