ClientCacheService
service
Service for client-side caching of data with expiry handling. Provides methods to get, update, and invalidate cache entries.
Methods
Section titled “Methods”Clear all client cache entries.
clear(): Observable<boolean>getFromCache
Section titled “getFromCache”Get cached entry by ID.
getFromCache(id: string, keepIfExpired: unknown): Observable<T | null>Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| id | string | |
| keepIfExpired | unknown |
invalidateCache
Section titled “invalidateCache”Invalidate cache entry by ID. This will remove the entry from the cache.
invalidateCache(id: string): Observable<boolean>Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| id | string |
updateCache
Section titled “updateCache”Update or add cache entry.
updateCache(id: string, data: T, ttl?: number): Observable<CacheEntry<T>>Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| id | string | |
| data | T | |
| ttl | number |