TTL & Expiry Calculator
When a TTL expires and how long is left — from seconds, a Cache-Control header (max-age, s-maxage, stale-while-revalidate) or an expiry date — and DNS windows.
Expiry instant, remaining time, elapsed time, each Cache-Control directive as its own deadline, and for DNS changes the latest moment a cache honouring the old TTL could still serve it.
Example: max-age=600, s-maxage=3600, stale-while-revalidate=60 set at 10:00: browsers refetch at 10:10 (stale until 10:11), CDNs at 11:00; a DNS record changed under a 24 h TTL may linger a day.
Seconds from a moment,
three ways to say it.
How each input style becomes an expiry, what the Cache-Control directives mean, and what the DNS window is.
Expiry arithmetic
A TTL is seconds counted from the moment the value was set (a DNS answer, a cache entry, a token). Expiry = set at + TTL; remaining = expiry − now. "Now" is the moment of calculation unless you pin it, and "set at" defaults to now too, so a bare TTL simply counts forward.
Cache-Control
max-age governs private (browser) caches, s-maxage overrides it for shared caches such as CDNs; stale-while-revalidate and stale-if-error extend serving past max-age while a refresh happens. Each directive is turned into its own deadline. no-store and no-cache are flagged because they change the meaning of the numbers.
DNS old-record window
After a DNS change, resolvers that cached the old record may keep answering with it until their copy’s TTL runs out — at most the previous TTL after your change. That is an upper bound for caches that honour TTLs; some clamp or ignore them, which no calculator can see. Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.
SOURCES
- RFC 9111 HTTP Caching §5.2 (Cache-Control directives) and RFC 9111 §4.2 freshness; RFC 5861 stale-while-revalidate / stale-if-error
- RFC 1035 §3.2.1 TTL semantics for DNS resource records (caches may keep a record for up to TTL seconds)
Last reviewed 20 September 2026. How results are checked: How we verify.