Skip to main content

Interface: CacheImplementation<E>

Type parameters

NameType
Eunknown

Methods

get

get(key, call): undefined | Buffer | Promise<undefined | Buffer>

Return buffer from cache. Returning falsy value is considered a cache miss.

Parameters

NameType
keystring
callProtoCatCall<E, Message, Message, Unary>

Returns

undefined | Buffer | Promise<undefined | Buffer>

Defined in

lib/server/middleware/cache.ts:15


hash

hash(call): undefined | string | Promise<undefined | string>

Create a unique cache key that will be used for response save and lookup.

Return falsy key if caching should be skipped

Parameters

NameType
callProtoCatCall<E, Message, Message, Unary>

Returns

undefined | string | Promise<undefined | string>

Defined in

lib/server/middleware/cache.ts:11


set

set(key, value, call): void

Set cache result. Result is not awaited and does not block the response nor subsequent requests

Parameters

NameType
keystring
valueBuffer
callProtoCatCall<E, Message, Message, Unary>

Returns

void

Defined in

lib/server/middleware/cache.ts:20