InMemoryCacheStore
Defined in: src/policies/traffic/cache.ts:37
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:41
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:94
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:89
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: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/policies/traffic/cache.ts:45
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:61
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>