InMemoryCacheStore
Defined in: src/policies/traffic/cache.ts:58
Response caching with pluggable storage, TTL, and automatic cache-control headers (priority 40).
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InMemoryCacheStore(
options?):InMemoryCacheStore
Defined in: src/policies/traffic/cache.ts:62
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”InMemoryCacheStore
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get size():
number
Defined in: src/policies/traffic/cache.ts:123
Current number of entries (for testing/inspection)
Returns
Section titled “Returns”number
Methods
Section titled “Methods”clear()
Section titled “clear()”clear():
void
Defined in: src/policies/traffic/cache.ts:118
Remove all entries (for testing)
Returns
Section titled “Returns”void
delete()
Section titled “delete()”delete(
key):Promise<boolean>
Defined in: src/policies/traffic/cache.ts:113
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”destroy()
Section titled “destroy()”destroy():
void
Defined in: src/policies/traffic/cache.ts:128
Release all cached entries.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”get(
key):Promise<Response|null>
Defined in: src/policies/traffic/cache.ts:66
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/policies/traffic/cache.ts:82
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>