Core concepts

Edge sync

With edge mode on, Glacier warms data close to your users — which means the same entry can live in many places at once. Edge sync keeps those copies coherent.


Turning on the edge

export const glacier = new Glacier({
  edge: true,
  region: 'auto',
})

With edge: true, prediction and warming run at the edge location nearest each request, so warmed data sits physically close to where the next request will originate.

How copies stay consistent

Each edge node keeps its own warm set. When an entry is invalidated anywhere, Glacier propagates a small invalidation message to every node holding that key. Propagation is asynchronous and typically completes in well under a second.

  • Invalidations always win. A node that hasn't yet received a propagation falls through to the origin fetch rather than serving a copy it can't confirm is fresh.
  • Warming is local. Predictions are computed per region, so a pattern popular in one geography doesn't waste fetches in another.

Designed for eventual consistency

Edge sync optimizes for availability and latency. If your data requires strict, read-your-writes consistency on every edge immediately, scope those keys out of Glacier with edge: false per call and let them hit the origin directly.

Per-key edge control

Override the global setting when a specific key shouldn't be warmed at the edge:

glacier.prefetch('account:balance', { edge: false })

Next: read Glacier.sync() for the programmatic sync API.

Previous
Cache invalidation