interface KvCacheOptions
Since 0.2.0

Wires a KV namespace up as the application's ICacheStore under CAPABILITIES.CACHE.

Properties

readonly
binding: string

The KV namespace binding name from wrangler.toml.

readonly
optional
name: string

Instance name. 'default' (the default) claims the bare cache token; anything else derives cache.<name>, matching CachePlugin's convention so several caches can coexist.

readonly
optional
prefix: string

Prefix applied to every cache key. Required to call clear(), and recommended whenever the namespace is shared.

readonly
optional
defaultTtlSeconds: number

TTL in seconds applied when set omits one. Omitted means no expiry.

Usage

import { type KvCacheOptions } from "cloudflare-plugin/src/index.ts";