SERVER / CACHE

Cache

One server-only key-value contract for Cloudflare KV, Redis, and Dowe Cache, with a fast persistent local engine during dowe dev.

1 / MENTAL MODEL

Declare Cache, operate with kv

cache creates the provider connection. kv owns key-value operations and their result bindings, independently from Database query.

dowe
handler cacheAppointment
  cache appCache provider:"dowe" host:env.CACHE_HOST port:env.CACHE_PORT account:env.CACHE_USER secret:env.CACHE_PASSWORD name:env.CACHE_DATABASE
  kv saved conn:appCache.set key:"appointment:1" value:{ patientName:"Ana" }
  kv value conn:appCache.get key:"appointment:1" required:true
  return json:{ ok:saved.ok data:value }
Part
Contract

No data

There are no records to display

2 / PROVIDERS

Choose the production adapter

Every provider uses the same required props. provider may use env.CACHE_PROVIDER; store credential names in .env.example and values in .env or the process environment.

Provider
Connection

No data

There are no records to display

3 / OPERATIONS

Read, write, list, and clear

required:true turns a missing get into a controlled NotFound result.

dowe
kv value conn:appCache.get key:"appointment:1"
kv saved conn:appCache.set key:"appointment:1" value:{ status:"scheduled" }
kv deleted conn:appCache.delete key:"appointment:1"
kv keys conn:appCache.keys prefix:"appointment:"
kv cleared conn:appCache.clear
Operation
Result

No data

There are no records to display

4 / DOWE DEV

Local without Wrangler

During dowe dev, all providers ignore the effective provider, resolve only name, and use the persistent Dowe engine at .dowe/kv. Host and credentials are not resolved, no remote provider starts, and no auxiliary port is opened.

dowe
.dowe/kv/<resolved-name>

5 / DOWE CACHE

Run the authenticated service

The Dowe provider authenticates before the WebSocket upgrade. Administrators create Cache names and accounts through dowe cache create-account.

dowe
main
  server port:4148
    cache service