{"uid":"cap_2t5vkckxC0rpiGZ1LuGeN","slug":"cache-freshness-calculate-e950dbfd","name":"Cache Freshness Calculate","description":"Cache Freshness Calculate: Cache Freshness Calculate calculates remaining freshness from response timing metadata from bounded caller-supplied values without an external provider. Call Cache Freshness Calculate before accepting, caching, redirecting, or retrying a caller-supplied web response. Returns normalized web evidence, the computed finding, and an explicit pass or advisory status for Cache Freshness Calculate as versioned deterministic JSON. Price: $0.001 USDC via x402 on Base. First-par…","url":"https://api.delx.ai/api/v1/x402/cache-freshness-calculate","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"now_epoch":{"type":"integer","description":"Now Epoch supplied to Cache Freshness Calculate; used only for this bounded calculation and processed in memory without retention."},"date_epoch":{"type":"integer","description":"Date Epoch supplied to Cache Freshness Calculate; used only for this bounded calculation and processed in memory without retention."},"age_seconds":{"type":"integer","description":"Age Seconds supplied to Cache Freshness Calculate; used only for this bounded calculation and processed in memory without retention."},"max_age_seconds":{"type":"integer","description":"Max Age Seconds supplied to Cache Freshness Calculate; used only for this bounded calculation and processed in memory without retention."}}},"responseSchema":{"type":"json","example":{"result":{"fresh":true,"remaining_seconds":200,"current_age_seconds":100},"schema":"delx/util-cache-freshness-calculate/v1","status":"pass","evidence":{"retained":false,"input_sha256":"dc06e6971edff08aae19366d5c94d9ebd945645757a1dda826dc3e155bb227dc","external_calls":0},"operation":"web_reliability:cache_freshness_calculate"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_QEHqJ5wLRWod65uEhI6Iw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates remaining HTTP cache freshness from caller-supplied response timing metadata (now, date, age, max-age) and returns a deterministic pass/advisory verdict","exampleAgentPrompt":"Check if a cached HTTP response is still fresh: the current time is epoch 1720000000, the response Date header is epoch 1719990000, the Age header is 500 seconds, and Cache-Control max-age is 3600 seconds.","exampleUseCases":[{"title":"Pre-cache freshness gate for agent pipelines","prompt":"Before I cache this web response, check if it's still fresh — current epoch is 1720005000, the response was dated at epoch 1719998000, Age is 300 seconds, and max-age is 7200 seconds."},{"title":"Retry decision based on stale cache","prompt":"I'm about to retry a fetch — tell me if the cached response I have is still valid: now is epoch 1720010000, Date was 1719980000, Age is 1800 seconds, max-age is 3600 seconds."},{"title":"Redirect freshness check before forwarding","prompt":"Before forwarding this cached redirect, verify it's still fresh: current epoch 1720020000, Date epoch 1720016000, Age 120 seconds, max-age 900 seconds."}],"resultDescription":"Returns versioned deterministic JSON containing normalized web evidence (the input timing values), the computed remaining freshness in seconds, and an explicit pass or advisory status indicating whether the cached response is still considered fresh.","failureModes":["Missing required fields (now_epoch, date_epoch, max_age_seconds) result in a validation error","Negative age_seconds or max_age_seconds may produce advisory or error responses","Epoch values far in the future or past may be flagged as out-of-bounds","Payment failure via x402 protocol returns 402 status before processing"],"whenToPreferThis":"Use this endpoint when you need a deterministic, stateless, auditable calculation of HTTP cache freshness from raw timing metadata — especially in agentic pipelines where you want a versioned, normalized JSON verdict (pass/advisory) before deciding to accept, cache, redirect, or retry a response. Prefer this over custom inline math when you need consistent handling and explicit evidence logging of cache freshness decisions.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:51:17.890Z","isFirstParty":false}