dox_cache library

Cache for Dart and Dox: memory, file and Redis drivers.

Classes

CacheClock
Gives the current time. Inject a fake one in tests to move time.
CacheConfig
Cache settings.
CacheConstants
Global constants for dox_cache.
CacheDriver
A cache backend. Values are JSON-encodable: Map, List, String, num, bool or null. Each driver adds its prefix to every key.
CacheDriverFactory
Builds a driver from the options of one store in the config. Register your own with CacheManager.extend.
CacheLock
An atomic lock. Only one owner can hold it at a time.
CacheManager
Gives named cache stores from the config. Each store is built once.
CacheStore
The main cache API for one store. Wraps a CacheDriver.
FileDriver
Keeps one JSON text file per key in directory.
FileDriverFactory
Builds a FileDriver. Options: path, prefix.
MemoryDriver
Keeps items in a map inside this isolate.
MemoryDriverFactory
Builds a MemoryDriver. Options: prefix, max_size.
MemoryEntry
One stored value with its expiry time.
MemoryLock
Lock kept in a MemoryDriver. Only works inside one isolate.
NullDriver
Stores nothing. Every read is a miss. Use it to turn caching off.
NullDriverFactory
Builds a NullDriver.
RedisDriver
Keeps items in Redis, shared by all isolates and servers.
RedisDriverFactory
Builds a RedisDriver with a new connection. Options: host, port, username, password, db, tls, prefix, pool_size. pool_size is the most connections to open (ioredis maxConnection). ioredis shares one connection and only opens more for blocking commands.
RedisLock
Lock kept in Redis. Works across processes.
TaggedCache
Tagged items. Each tag has a version number in the cache. Keys get a namespace made from the versions. Flushing a tag raises its version, so old items are not found anymore.