The KV namespace binding
Wall clock; pass IRuntimeServices
Optionaloptions: KvCacheStoreOptions
Key prefix and default TTL
Removes a cached value.
Cache key
true if an entry was removed
Reads a cached value.
The expected value type
Cache key
The value, or null when absent or expired
Reports whether a live entry exists.
Cache key
true if present and unexpired
Stores a value.
The value type
Cache key
Value to store
OptionalttlSeconds: number
Time-to-live in seconds; omit for the store default
A cache store backed by Workers KV.
Two platform properties are worth knowing before choosing this store over a Durable Object or an origin cache:
setis not guaranteed visible to a read in another location immediately. KV suits read-heavy, tolerant caching, not coordination.kv-envelope.ts.Example
Since
0.2.0