Skip to main content

Confirm

Are you sure?

Glossary

Cache TTL

The single number that decides how often you pay to fetch the same page again.

By · Last updated: September 2026

TL;DR

A cache TTL (time to live) is how long a stored result may be reused before it counts as stale and has to be fetched again. In HTTP it is expressed as Cache-Control: max-age, in seconds. A longer TTL means fewer fetches and older data; a TTL of zero means always fetch fresh.

Free plan, no credit card. 1,000 credits a month.

How it works

How a TTL works

A cache stores a response with the time it was made. When the same request comes again, the cache compares the result's age with the TTL: younger, and it is served from storage; older, and the request goes to the origin and the new response replaces the old. In HTTP the server usually sets the TTL (Cache-Control: max-age=3600), and clients can ask for fresher data with max-age in the request.

Choosing one is a trade. A product page you check daily does not need to be fetched every minute; a status page might. The right TTL is the oldest data your use can tolerate.

URLpipe

max_age in URLpipe

Every endpoint takes max_age: how old a stored result may be for you to accept it. It defaults to 7 days, goes from 0 to 30 days, and takes seconds or durations like "1 hour" or "2 days". max_age=0 always fetches fresh.

A cache hit runs nothing, so it costs nothing and is served even when your allowance is used up. Every response says which you got: X-Cache: hit or miss, and on a hit X-Cache-Age in seconds.

Accept anything under an hour old
curl -sD - -o /dev/null -X POST https://urlpipe.dev/markdown \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "sync": true, "max_age": "1 hour"}' | grep -i '^x-cache'

# x-cache: hit
# x-cache-age: 2143

The cache belongs to your organization — one project's fetch is another's free hit — and is keyed by operation, URL and every option that changes the result, so a mobile audit never answers a desktop request. See Caching & freshness.

Note the direction. An HTTP cache lets the origin decide how long its response lives; here the caller decides how old a result it will accept, per request. The same stored result can answer a dashboard that accepts a day-old copy and be skipped by a monitor that asks for max_age=0.

FAQ

Frequently asked questions

What is a good cache TTL?
The oldest data you can tolerate. Days for articles and documentation, hours for prices and listings, minutes or zero for pages you are monitoring for change.
What does max-age=0 mean?
That no stored result is fresh enough: fetch the resource again.
Are URLpipe cache hits billed?
No. A hit runs no analysis and spends no credits.

See it on your own pages.

Free plan, no card. Confirm your email and your API key is live — you'll be making real requests in minutes.