Protected constructorPrivate Readonly REGISTRY_Private _configPrivate _initializePrivate _initializedPrivate _persistPrivate _registryPrivate _statsPrivate _storageReturns the current configuration
Returns whether the cache manager has been initialized
Static InstanceReturns the singleton instance of LocalCacheManager
Clears all cache entries of a specific type.
The cache entry type to clear
The number of entries cleared
Clears a cached dataset.
The dataset name
Optional filters applied to the dataset
Prefix for the cache key
Generates a human-readable cache fingerprint for a RunQuery request.
Format: QueryName|QueryID|params|connection Example: GetActiveUsers|abc123|{"status":"active"}|localhost
Optional queryId: stringThe query ID
Optional queryName: stringThe query name
Optional parameters: Record<string, unknown>Optional query parameters
Optional connectionPrefix: stringPrefix identifying the connection (e.g., server URL) to differentiate caches across connections
A unique, human-readable fingerprint string
Generates a human-readable cache fingerprint for a RunView request. This fingerprint uniquely identifies the query based on its parameters and connection.
Format: EntityName|filter|orderBy|resultType|maxRows|startRow|connection Example: Users|Active=1|Name ASC|simple|100|0|localhost
The RunView parameters
Optional connectionPrefix: stringPrefix identifying the connection (e.g., server URL) to differentiate caches across connections
A unique, human-readable fingerprint string
Returns all cache entries for dashboard display.
Retrieves a cached dataset.
The dataset name
Optional filters applied to the dataset
Prefix for the cache key
The cached dataset or null if not found
Gets the timestamp of a cached dataset.
The dataset name
Optional filters applied to the dataset
Prefix for the cache key
The cache timestamp or null if not found
Returns cache entries filtered by type.
The cache entry type to filter by
The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.
Gets the cache status (fingerprint data) for a RunQuery result. Used for smart cache validation with the server.
The cache fingerprint
The cache status with maxUpdatedAt and rowCount, or null if not found/expired
Retrieves a cached RunQuery result.
The cache fingerprint
The cached results, maxUpdatedAt, rowCount, and queryId, or null if not found
Retrieves a cached RunView result.
The cache fingerprint
The cached results, maxUpdatedAt, and rowCount, or null if not found
Returns comprehensive cache statistics.
Initialize the cache manager with a storage provider. This should be called during app startup after the storage provider is available.
This method is safe to call multiple times - subsequent calls will return the same promise as the first caller, ensuring initialization only happens once.
The local storage provider to use for persistence
Optional config: Partial<LocalCacheManagerConfig>Optional configuration overrides
A promise that resolves when initialization is complete
Checks if a dataset is cached.
The dataset name
Optional filters applied to the dataset
Prefix for the cache key
True if the dataset is cached
Stores a dataset in the local cache.
The dataset name
Optional filters applied to the dataset
The dataset result to cache
Prefix for the cache key (typically includes connection info)
Stores a RunQuery result in the cache.
The cache fingerprint
The query name for display
The results to cache
The latest update timestamp (for smart cache validation)
Optional rowCount: numberOptional row count (defaults to results.length if not provided)
Optional queryId: stringOptional query ID for reference
Optional ttlMs: numberOptional TTL in milliseconds (for cache expiry tracking)
Stores a RunView result in the cache.
The cache fingerprint (from GenerateRunViewFingerprint)
The original RunView parameters
The results to cache
The latest __mj_UpdatedAt from the results
Optional rowCount: numberOptional row count (defaults to results.length if not provided)
Updates the configuration at runtime
Private buildBuilds a cache key for a dataset.
Private debouncedPrivate doInternal initialization logic - only called once by the first caller
Optional config: Partial<LocalCacheManagerConfig>Private estimatePrivate evictPrivate evictPrivate getMaps a cache entry type to its storage category.
Private loadPrivate persistPrivate recordPrivate registerRegisters a cache entry in the registry.
Private unregisterProtected Static getReturns the singleton instance of the class. If the instance does not exist, it is created and stored in the Global Object Store. If className is provided it will be used as part of the key in the Global Object Store, otherwise the actual class name will be used. NOTE: the class name used by default is the lowest level of the object hierarchy, so if you have a class that extends another class, the lowest level class name will be used.
LocalCacheManager is a singleton that provides a unified caching abstraction for datasets, RunView results, and RunQuery results. It wraps ILocalStorageProvider for actual storage and maintains an internal registry of all cached items.
Key features:
Usage: