IMultiTierCache<T>
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / IMultiTierCache
Interface: IMultiTierCache<T>
Section titled “Interface: IMultiTierCache<T>”Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3067
Multi-tier cache interface
Extends
Section titled “Extends”IProofCache<T>
Type Parameters
Section titled “Type Parameters”T = SingleProof
Methods
Section titled “Methods”get(
key):Promise<CacheLookupResult<T>>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2976
Get an entry from the cache
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<CacheLookupResult<T>>
Inherited from
Section titled “Inherited from”set(
key,value,ttlMs?):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2980
Set an entry in the cache
Parameters
Section titled “Parameters”string | CacheKey
T
ttlMs?
Section titled “ttlMs?”number
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”delete()
Section titled “delete()”delete(
key):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2984
Delete an entry from the cache
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”has(
key):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2988
Check if an entry exists
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”clear()
Section titled “clear()”clear():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2992
Clear all entries
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”getStats()
Section titled “getStats()”getStats():
ProofCacheStats
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2996
Get cache statistics
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”keys()
Section titled “keys()”keys(
pattern?):Promise<string[]>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3000
Get all keys matching a pattern
Parameters
Section titled “Parameters”pattern?
Section titled “pattern?”string
Returns
Section titled “Returns”Promise<string[]>
Inherited from
Section titled “Inherited from”addEventListener()
Section titled “addEventListener()”addEventListener(
listener):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3004
Add an event listener
Parameters
Section titled “Parameters”listener
Section titled “listener”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”removeEventListener()
Section titled “removeEventListener()”removeEventListener(
listener):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3008
Remove an event listener
Parameters
Section titled “Parameters”listener
Section titled “listener”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”IProofCache.removeEventListener
getMemoryCache()
Section titled “getMemoryCache()”getMemoryCache():
ILRUCache<T>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3071
Get the memory cache tier
Returns
Section titled “Returns”ILRUCache<T>
getPersistentCache()
Section titled “getPersistentCache()”getPersistentCache():
IPersistentCache<T> |null
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3075
Get the persistent cache tier (if available)
Returns
Section titled “Returns”IPersistentCache<T> | null
warm()
Section titled “warm()”warm(
keys):Promise<WarmingResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3079
Warm the cache with specific keys
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<WarmingResult>
startWarming()
Section titled “startWarming()”startWarming(
config?):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3083
Start automatic cache warming
Parameters
Section titled “Parameters”config?
Section titled “config?”Returns
Section titled “Returns”void
stopWarming()
Section titled “stopWarming()”stopWarming():
void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3087
Stop automatic cache warming
Returns
Section titled “Returns”void
invalidate()
Section titled “invalidate()”invalidate(
rules):Promise<number>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3091
Apply invalidation rules
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<number>
dispose()
Section titled “dispose()”dispose():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3095
Dispose of the cache and cleanup resources
Returns
Section titled “Returns”Promise<void>