Clean up expired entries from the cache. This can be called periodically to free up memory.
Number of expired entries removed
Clear cache for specific query or all queries.
OptionalqueryId: stringOptional query ID to clear specific query cache
Get cached results if available and not expired. Updates access order for LRU tracking and increments hit counter.
The query identifier
The query parameters
Cache configuration settings
The cached entry if valid, null otherwise
Get cached results for a specific page of a paged query. The cache key includes startRow and maxRows to distinguish pages.
Get cache statistics for monitoring and debugging.
Object containing cache performance metrics
Get a cached TotalRowCount for a query + params combination. Returns null if not cached or expired.
Cache query results with TTL and LRU eviction. Evicts least recently used entries when at capacity.
The query identifier
The query parameters
The query results to cache
Cache configuration settings
Cache results for a specific page of a paged query.
Cache a TotalRowCount for a query + params combination.
StaticGenerateGenerate a deterministic cache key for an ad-hoc SQL query using FNV-1a hash.
Returns a string prefixed with adhoc: followed by the hash.
LRU (Least Recently Used) cache implementation for query results with TTL support. This cache provides efficient storage and retrieval of query results with automatic expiration based on time-to-live settings and size limits.
Supports three caching modes:
get()/set()GetPaged()/SetPaged()with page-aware keysGetTotalRowCount()/SetTotalRowCount()