CacheApiCacheStore
Defined in: src/adapters/cloudflare.ts:48
Response cache backed by the Cloudflare Cache API.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CacheApiCacheStore(
cache?,origin?):CacheApiCacheStore
Defined in: src/adapters/cloudflare.ts:56
Parameters
Section titled “Parameters”cache?
Section titled “cache?”Cache
A Cache instance (e.g. caches.default). Falls back to caches.default when omitted.
origin?
Section titled “origin?”string
Synthetic origin used to construct cache keys. Default: "https://edge-gateway.internal".
Returns
Section titled “Returns”CacheApiCacheStore
Methods
Section titled “Methods”delete()
Section titled “delete()”delete(
key):Promise<boolean>
Defined in: src/adapters/cloudflare.ts:84
Delete a cached entry. Returns true if something was removed.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”get(
key):Promise<Response|null>
Defined in: src/adapters/cloudflare.ts:62
Retrieve a cached response by key. Returns null on miss.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<Response | null>
Implementation of
Section titled “Implementation of”put(
key,response,ttlSeconds):Promise<void>
Defined in: src/adapters/cloudflare.ts:68
Store a response under key with a TTL in seconds.
Parameters
Section titled “Parameters”string
response
Section titled “response”Response
ttlSeconds
Section titled “ttlSeconds”number
Returns
Section titled “Returns”Promise<void>