HTTP cacheability, CORS and redirect-loop explainer

$0.005 USDC per call · Developer and security · POST /api/v1/http-cache-explain · Id http-cache-explain

Explains from supplied response headers (and optionally the request's headers, a CORS request, and a redirect chain) whether a shared and a private HTTP cache may store the response (RFC 9111 section 3), its freshness lifetime and basis (s-maxage, max-age, Expires minus Date, or the 10% Last-Modified heuristic), Vary, invalid max-age or Expires, the CORS check and preflight outcome per the Fetch Standard (Allow-Origin, Allow-Credentials, Allow-Methods/Headers, Vary: Origin), and a redirect loop or the 20-redirect limit. For developers and agents debugging stale or leaking caches. Does NOT fetch anything, read a clock (lifetimes are not compared to now), model a specific CDN's overrides, or evaluate Cache-Control extensions such as stale-while-revalidate.

What you get

Turns a block of headers into a reasoned cacheability and CORS verdict instead of a guess.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/http-cache-explain. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/http-cache-explain \
  -H 'content-type: application/json' \
  -d '{"response":{"status":200,"headers":[{"name":"Cache-Control","value":"public, max-age=300"},{"name":"Access-Control-Allow-Origin","value":"https://app.example"},{"name":"Date","value":"Tue, 03 Nov 2026 10:00:00 GMT"}]},"cors":{"origin":"https://app.example"}}'

Input

FieldTypeRequiredDescription
responseobjectyes
requestobjectno
corsobjectno
redirectsarray<object>; max 30 itemsno

Example request body

{
  "response": {
    "status": 200,
    "headers": [
      {
        "name": "Cache-Control",
        "value": "public, max-age=300"
      },
      {
        "name": "Access-Control-Allow-Origin",
        "value": "https://app.example"
      },
      {
        "name": "Date",
        "value": "Tue, 03 Nov 2026 10:00:00 GMT"
      }
    ]
  },
  "cors": {
    "origin": "https://app.example"
  }
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
sharedobjectno
privateobjectno
cacheControlobjectnoParsed Cache-Control directives (first occurrence wins).
varyarray<string>no
ageSecondsanynoAge header value or null.
corsanynoCORS check outcome {ok, issues, acao, maxAgeSeconds}; null when no cors input.
redirectsanyno{count, loop, limitExceeded, hops}; null when no redirects input.
warningsarray<string>no
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the infra-preflight-kit package.

Machine-readable