Skip to content

Download one cached object

GET
/domains/{domain}/cache/keys/content
curl --request GET \
--url 'https://api.nsin.ir/domains/example.com/cache/keys/content?hostname=example&node=example&key_hash=example' \
--header 'Authorization: Bearer <token>'

The stored bytes behind a listing row, read straight from cache storage — your origin is never contacted, so this works even when the site is down.

Address the entry by its stored identity: copy hostname, node and key_hash verbatim from a /domains/{domain}/cache/keys row. node is the edge location that cached it, so the same URL cached at three locations is three entries and you choose which copy you get.

The body is returned in its original uncompressed form with the stored Content-Type, always as an attachment. The cached response’s own status code and age travel in X-Nsin-Cache-Status and X-Nsin-Cached-At — the HTTP status describes only whether the read succeeded.

A 404 with entry is no longer cached means the listing row outlived the object (it expired, was evicted, or was purged). Requires domain.view.

domain
required
string

The domain name (for example example.com) — not a numeric id.

Example
example.com
hostname
required
string

The row’s hostname — the storage namespace, not the request host.

node
required
string

The row’s node — the edge location holding this copy. Case-sensitive.

key_hash
required
string

The row’s key_hash.

The stored object. Content-Type is whatever was cached; the payload is the uncompressed body.

Media type application/octet-stream
string format: binary
X-Nsin-Cache-Node
string

Edge location this copy came from.

X-Nsin-Cache-Status
integer

HTTP status of the cached response.

X-Nsin-Cached-At
string format: date-time

When the object was cached (RFC 3339).

Missing or malformed hostname, node or key_hash.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

Missing, malformed, revoked or expired API key — or the owning account is inactive.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"error": "invalid API key"
}

Domain or hostname not yours, or the entry is no longer cached.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}

The stored entry could not be decoded.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

Cache storage is unavailable.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}