Documentation menu

Docs › Caching

Origin shield

Origin shield places one of seven shield locations between the edge and your origin, so a miss in many cities becomes a single request to you.

How it works

Without a shield, each of the 52 edge locations fetches from your origin on its own first miss. With a shield, edge locations ask the shield first. The shield fetches from your origin once and every edge location is filled from there.

Concurrent requests for the same object are also collapsed: if 3,000 visitors ask for a new video segment within the same second, your origin receives exactly one request.

Choosing a shield

Shield locations are Amsterdam (AMS), Frankfurt (FRA), Ashburn (IAD), San Jose (SJC), São Paulo (GRU), Singapore (SIN) and Tokyo (NRT). With shield = "auto" we measure latency from every shield to your origin and choose the closest; pin one if you prefer.

TOML
[site]
hostname = "www.example.com"
origin   = "origin.example.com"
shield   = "FRA"   # or "auto"

# Optional: a second shield for an origin in another region
[[origins]]
name   = "media"
host   = "media-us.example.com"
shield = "IAD"

Request collapsing settings

SettingDefaultDescription
collapsetrueMerge concurrent misses for the same key.
collapse_timeout15sHow long waiting requests wait before going to origin themselves.
origin_keepalive90sIdle time before pooled origin connections close.

When not to use a shield

A shield adds one network hop on a miss. For content that is almost never cached, such as personalised API responses, set bypass = true on that path; bypassed requests go straight from the edge to your origin.

Was this page helpful? Tell us what was missing at support@cache.bz. Every message is read by the team that writes these docs.