Cache

The cache is a TTL scratch cache: short-lived, app-scoped storage for values you can afford to lose and recompute. It is distinct from the KV store, which is a durable string store.

Endpoints

All POST, scoped by X-Bext-App-Id (see SDK Overview):

Endpoint Use
/cache/set Store a value with a TTL.
/cache/get Read a cached value.
/cache/invalidate Drop a cached value.
curl -s http://127.0.0.1/__bext/sdk/cache/set \
  -H "X-Bext-App-Id: <app-id>" \
  -H "Content-Type: application/json" \
  -d '{ "key": "rates", "value": { "usd": 1.08 } }'

Cache vs KV

Cache KV
Purpose TTL scratch — recomputable values Durable string store
Lifetime Short-lived, expires Persists until deleted (optional TTL)
Listing Prefix list / entries
Endpoints set / get / invalidate get / set / delete / list / entries

Use the cache for memoizing an expensive computation or an upstream response you can re-fetch. Use KV when the data must survive — session-adjacent state, job records, and anything you cannot recompute.

Where to next

Page What it covers
KV Store The durable string store
SDK Overview The loopback SDK model