Skip to content

MultiTierCache<T>

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / MultiTierCache

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

Multi-tier cache combining in-memory LRU with optional persistent storage

T = SingleProof

new MultiTierCache<T>(config?, persistentConfig?): MultiTierCache<T>

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

Partial<MultiTierCacheConfig>

Partial<PersistentCacheConfig>

MultiTierCache<T>

initialize(): Promise<void>

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

Initialize the multi-tier cache

Promise<void>


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

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

Get an entry from the cache

string | CacheKey

Promise<CacheLookupResult<T>>

IMultiTierCache.get


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

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

Set an entry in the cache

string | CacheKey

T

number

Promise<boolean>

IMultiTierCache.set


delete(key): Promise<boolean>

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

Delete an entry from the cache

string | CacheKey

Promise<boolean>

IMultiTierCache.delete


has(key): Promise<boolean>

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

Check if an entry exists

string | CacheKey

Promise<boolean>

IMultiTierCache.has


clear(): Promise<void>

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

Clear all entries

Promise<void>

IMultiTierCache.clear


getStats(): ProofCacheStats

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

Get cache statistics (combined from both tiers)

ProofCacheStats

IMultiTierCache.getStats


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

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

Get all keys matching a pattern

string

Promise<string[]>

IMultiTierCache.keys


addEventListener(listener): void

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

Add an event listener

CacheEventListener

void

IMultiTierCache.addEventListener


removeEventListener(listener): void

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

Remove an event listener

CacheEventListener

void

IMultiTierCache.removeEventListener


getMemoryCache(): ILRUCache<T>

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

Get the memory cache tier

ILRUCache<T>

IMultiTierCache.getMemoryCache


getPersistentCache(): IPersistentCache<T> | null

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

Get the persistent cache tier (if available)

IPersistentCache<T> | null

IMultiTierCache.getPersistentCache


warm(keys): Promise<WarmingResult>

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

Warm the cache with specific keys

CacheKeyComponents[]

Promise<WarmingResult>

IMultiTierCache.warm


startWarming(config?, generator?): void

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

Start automatic cache warming

CacheWarmingConfig

(key) => Promise<T>

void

IMultiTierCache.startWarming


stopWarming(): void

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

Stop automatic cache warming

void

IMultiTierCache.stopWarming


invalidate(rules): Promise<number>

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

Apply invalidation rules

InvalidationRule[]

Promise<number>

IMultiTierCache.invalidate


dispose(): Promise<void>

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

Dispose of the cache

Promise<void>

IMultiTierCache.dispose