Abstract base class for cache backends
Public fields
config
Cache configuration
stats
Cache statistics
Methods
Method new()
Create a new cache
Arguments
config
CacheConfig object
Get a value from cache
Returns
Cached value or NULL
Method set()
Set a value in cache
Usage
BaseCache$set(key, value, ttl = NULL)
Arguments
key
Cache key
value
Value to cache
ttl
Time to live (optional)
Method delete()
Delete a key from cache
Method clear()
Clear all cache entries
Method size()
Get cache size
Method get_many()
Get multiple values
Arguments
keys
Character vector of keys
Returns
Named list of values
Method set_many()
Set multiple values
Usage
BaseCache$set_many(items, ttl = NULL)
Arguments
items
Named list of values
ttl
Time to live
Method delete_many()
Delete multiple keys
Usage
BaseCache$delete_many(keys)
Arguments
keys
Character vector of keys
Returns
Integer count of deleted keys
Method make_key()
Make a prefixed key
Method clone()
The objects of this class are cloneable with this method.
Usage
BaseCache$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.