Skip to content

InMemoryCacheStore

Defined in: src/policies/traffic/cache.ts:37

Response caching with pluggable storage, TTL, and automatic cache-control headers (priority 40).

new InMemoryCacheStore(options?): InMemoryCacheStore

Defined in: src/policies/traffic/cache.ts:41

InMemoryCacheStoreOptions

InMemoryCacheStore

get size(): number

Defined in: src/policies/traffic/cache.ts:94

Current number of entries (for testing/inspection)

number

clear(): void

Defined in: src/policies/traffic/cache.ts:89

Remove all entries (for testing)

void


delete(key): Promise<boolean>

Defined in: src/policies/traffic/cache.ts:84

Delete a cached entry. Returns true if something was removed.

string

Promise<boolean>

CacheStore.delete


get(key): Promise<Response | null>

Defined in: src/policies/traffic/cache.ts:45

Retrieve a cached response by key. Returns null on miss.

string

Promise<Response | null>

CacheStore.get


put(key, response, ttlSeconds): Promise<void>

Defined in: src/policies/traffic/cache.ts:61

Store a response under key with a TTL in seconds.

string

Response

number

Promise<void>

CacheStore.put