Skip to main content
Cache rules tell the edge how long to keep a response and what counts as the same response. A high cache-hit ratio is the cheapest way to lower origin load and improve P95 latency.

How the edge cache works

The edge stores responses keyed by URL (and selected headers / query params). On the next request for the same key, it serves the cached copy until TTL expires.

General Info

Cache Rule

General Info

Rule Configurations

Cache Rule

Rule Configurations

Enabling Ignore Query String in Cache Key on a path with legitimate variant query strings (e.g. ?w=400 for image resize) collapses every variant to the same cache entry. Scope the rule to a precise prefix.

TTL recipes

Verify cache behavior

Expected:
age is seconds since the edge cached this object. When age approaches max-age, the next request triggers a revalidation.

Cache key tuning

By default the cache key is host + path + sorted query string. You typically want to drop:
  • Tracking paramsutm_*, fbclid, gclid. They don’t change the response.
  • Session-style params — only on truly static assets.
Use a regex rule with Ignore Query String in Cache Key on the static prefix only.

Compression

Tenbyte CDN supports Gzip (and increasingly Brotli) at the edge. Enable on text-based MIME types only — already-compressed binary (images, video, archives) gains nothing.

Manage via API

See the CDN API reference for canonical fields.

Operational tips

  • Tune by hit ratio. Cache hit ratio below 80% on static content usually means a noisy query string or wrong TTL.
  • Stale-while-revalidate where supported. Origin can emit Cache-Control: max-age=60, stale-while-revalidate=86400 for a smooth deploy story.
  • Don’t Never Cache everything. Even short TTLs (5–10 s) blunt traffic spikes hard.
  • Purge before changing TTL down. A long-cached object stays cached for the original TTL — cut TTL and purge to roll out.
  • Watch Vary. Origin returning Vary: User-Agent fragments the cache by browser. Strip or narrow at the edge.

Troubleshooting