cache.clear/v1

cache/v1 is for an app's own code. This contract lets the app's admins empty its buckets from outside that code, after a change that left stale entries behind: one bucket by name, or every bucket the app has.

A wire contract at /api/_c/cache.clear/v1 (clear.go), one provider: whoever provides cache/v1 provides this too.

Use

pocketone remote cache clear --bucket pages.render   # one bucket
pocketone remote cache clear                          # every bucket of the app
curl -X POST -H "Authorization: <token with cache>" -d '{"bucket":"pages.render"}' https://your.app/api/_c/cache.clear/v1

The answer says how many keys went (keys).

Provide

Implement clearv1.Clearer and provide it in Register beside your cache/v1 provider (clearv1.Contract.Provide(app, c)). Empty only the calling app's buckets, never another app's on a shared store.

Commands and APIs

Every operation is a REST endpoint, a pocketone command and an MCP tool, all generated from the contract and behind the same token scope check and hooks. See Remote CLI, or the full CLI, Extension APIs and MCP references.

clear

Empties one of the app's cache buckets, or every bucket it has.

REST POST /api/_c/cache.clear/v1
CLI pocketone remote cache clear --bucket <value>
MCP cache_clear_clear
Token scope cache
Input field Flag Type
bucket --bucket string

Extensions

Extension
cache provides (default)

License

MIT