Skip to content

IMultiTierCache<T>

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / IMultiTierCache

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3067

Multi-tier cache interface

T = SingleProof

get(key): Promise<CacheLookupResult<T>>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2976

Get an entry from the cache

string | CacheKey

Promise<CacheLookupResult<T>>

IProofCache.get


set(key, value, ttlMs?): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2980

Set an entry in the cache

string | CacheKey

T

number

Promise<boolean>

IProofCache.set


delete(key): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2984

Delete an entry from the cache

string | CacheKey

Promise<boolean>

IProofCache.delete


has(key): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2988

Check if an entry exists

string | CacheKey

Promise<boolean>

IProofCache.has


clear(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2992

Clear all entries

Promise<void>

IProofCache.clear


getStats(): ProofCacheStats

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2996

Get cache statistics

ProofCacheStats

IProofCache.getStats


keys(pattern?): Promise<string[]>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3000

Get all keys matching a pattern

string

Promise<string[]>

IProofCache.keys


addEventListener(listener): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3004

Add an event listener

CacheEventListener

void

IProofCache.addEventListener


removeEventListener(listener): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3008

Remove an event listener

CacheEventListener

void

IProofCache.removeEventListener


getMemoryCache(): ILRUCache<T>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3071

Get the memory cache tier

ILRUCache<T>


getPersistentCache(): IPersistentCache<T> | null

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3075

Get the persistent cache tier (if available)

IPersistentCache<T> | null


warm(keys): Promise<WarmingResult>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3079

Warm the cache with specific keys

CacheKeyComponents[]

Promise<WarmingResult>


startWarming(config?): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3083

Start automatic cache warming

CacheWarmingConfig

void


stopWarming(): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3087

Stop automatic cache warming

void


invalidate(rules): Promise<number>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3091

Apply invalidation rules

InvalidationRule[]

Promise<number>


dispose(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3095

Dispose of the cache and cleanup resources

Promise<void>