Edge Cache

Edge Cache documentation

Edge Cache is a small HTTP caching layer that sits in front of an origin server and answers repeat requests from a node close to the visitor. This page is the operator reference: cache keys, freshness rules, the purge endpoint and the response headers you can expect to see.

How a request is served

A request arriving at a node is normalised into a cache key. If a fresh object exists for that key it is returned immediately. If the object exists but has expired, the node revalidates it against the origin with a conditional request. If nothing is stored, the node fetches the object, stores it when it is cacheable and returns it to the visitor.

Cache key

The default key is the scheme, host, path and the sorted query string. The fragment is never part of the key, and cookies are ignored unless the origin marks a response as varying on them.

https://example.com/assets/app.css?v=8
  -> https|example.com|/assets/app.css|v=8

Freshness

Origin directives win. A node only applies its own default TTL when the origin sends no explicit freshness information at all.

Origin sendsNode behaviour
Cache-Control: max-age=NStored for N seconds.
Cache-Control: no-storeNever stored.
Cache-Control: privateNever stored on a shared node.
Expires onlyUsed when no max-age is present.
nothingDefault TTL of 600 s for 200, 30 s for 404.

Response headers

Every response carries a status header describing what the node did:

X-CacheMeaning
HITServed from the node, still fresh.
MISSNot stored; fetched from the origin.
REVALIDATEDStored but stale; origin confirmed it with 304.
BYPASSRequest or response was not cacheable.

Age reports how many seconds the stored copy has been held. Range requests, ETag and Last-Modified pass through unchanged.

Purging

A purge removes one object from every node. Purges are asynchronous; the call returns as soon as the request is accepted, and propagation normally completes within a few seconds.

curl -X POST https://docs.cdn-edge.space/api/purge \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com/assets/app.css?v=8"}'

Prefix purges use {"prefix":"https://example.com/assets/"} instead of url. A prefix purge is rate limited to one call per minute per zone, because it invalidates every matching object on every node.

Compression

Nodes store one copy per encoding actually negotiated. If the origin sends an uncompressed body and the visitor accepts gzip, the node compresses once and reuses the result. Origins that already compress are passed through untouched — double compression is never applied.

Limits

Maximum object size512 MB
Maximum TTL31 days
Origin connect timeout5 s
Origin read timeout60 s

Troubleshooting

Everything is a MISS

Check the origin's Cache-Control. A single private or no-store directive disables storage entirely, and many application frameworks add one by default to every response that touches a session.

Stale content after a deploy

Version your asset URLs rather than relying on purges. A changed query string is a different cache key and takes effect immediately everywhere.

A purge did not take effect

Purges match the full normalised key. ?v=8 and ?v=9 are two different objects, and purging one leaves the other in place.