Install from: silverbullet-libraries/src/cache at main · malys/silverbullet-libraries · GitHub
TTL cache manager
This script (mls.cache.ttl) wraps the JavaScript @isaacs/ttlcache library, allowing Lua code to utilize a TTL cache with methods for setting, getting, and managing cached data with automatic expiration.
warning Caution On system start a globally accessible cache manager mls.cache.ttl.CacheManager is created. This allows other parts of the application to easily utilize a pre-configured TTL cache. Default configuration is: ttl: 10mn max entries: 100
LRU cache manager
This script (mls.cache.lru) wraps the JavaScript @isaacs/lrucache library, allowing Lua code to utilize a LRU cache with methods for setting, getting, and managing cached data with automatic expiration.
warning Caution On system start a globally accessible cache manager mls.cache.lru.CacheManager is created. This allows other parts of the application to easily utilize a pre-configured LRU cache. Default configuration is: max entries: 100
Features
LRU eviction
TTL support
Fetch-on-miss
Serialization (dump/load)
Snapshot iteration
Global preconfigured cache