Skip to content

ClientCacheService

service

Service for client-side caching of data with expiry handling. Provides methods to get, update, and invalidate cache entries.

Clear all client cache entries.

clear(): Observable<boolean>

Get cached entry by ID.

getFromCache(id: string, keepIfExpired: unknown): Observable<T | null>
NameTypeDescription
idstring
keepIfExpiredunknown

Invalidate cache entry by ID. This will remove the entry from the cache.

invalidateCache(id: string): Observable<boolean>
NameTypeDescription
idstring

Update or add cache entry.

updateCache(id: string, data: T, ttl?: number): Observable<CacheEntry<T>>
NameTypeDescription
idstring
dataT
ttlnumber