In-memory LRU cache with TTL support
Ultra-low latency, limited by available RAM. Best for hot data, session data, frequently accessed vectors.
VectrixDB::BaseCache -> MemoryCache
new()Create a new MemoryCache
MemoryCache$new(config = NULL)configCacheConfig object
keyCache key
Value or NULL
set()Set value in cache
MemoryCache$set(key, value, ttl = NULL)keyCache key
valueValue to cache
ttlTime to live
delete()Delete key from cache
MemoryCache$delete(key)keyCache key
Logical success
keyCache key
Logical
clear()Clear cache
MemoryCache$clear()
size()Get cache size
MemoryCache$size()Integer
cleanup_expired()Cleanup expired entries
MemoryCache$cleanup_expired()Integer count removed
clone()The objects of this class are cloneable with this method.
MemoryCache$clone(deep = FALSE)deepWhether to make a deep clone.