bloom_cache 0.3.1
bloom_cache: ^0.3.1 copied to clipboard
Server-side caching abstraction and backends (In-Memory LRU, Database, Redis) with HTTP response caching middleware for Bloom applications.
Changelog #
0.3.1 - 2026-08-31 #
Security & Reliability Hardening #
- Atomic Redis Lua Scripts & Key-to-Tag Index: Replaced all
KEYS-based tag maintenance with atomic Lua scripts and tracked key-to-tag indexes (__key_tags:<key>).set,delete, andinvalidateTagsnow execute atomically in Redis in O(T) time without global key scanning. - Safe Scan-Based Redis Clearing:
clearnow performs cursor-basedSCANbatch deletions in Lua matching the configured prefix and never executesFLUSHDB. Clearing an unprefixedRedisCacheis rejected by default to prevent accidental data loss, requiring explicitallowEmptyPrefixClear: true. - Transactional SQL DatabaseCache: Wrapped
DatabaseCache.set,delete,clear,invalidateTags, andpruneExpiredin atomic database transactions. - Tag Cleanup in Expired Pruning:
DatabaseCache.pruneExpirednow transactionally deletes corresponding tag associations in${tableName}_tagsalongside expired cache rows.
0.2.0 - 2026-08-23 #
Breaking #
- Now depends on
bloom_serverinstead ofbloom_framework. Imports change frompackage:bloom_framework/bloom_server.darttopackage:bloom_server/bloom_server.dart. - No longer requires Flutter. The package now resolves against the Flutter-free
bloom_servercore, so it can be used from a plaindart run/dart compilebackend.
0.1.0 #
- Initial release of
bloom_cache. - Core abstract
BloomCacheinterface with JSON round-trip serialization and concurrentgetOrSetdeduplication. InMemoryCachewith real LRU eviction usingLinkedHashMapand capacity bounds.DatabaseCachebacked bybloom_dband its unifiedDbExecutorabstraction (PostgreSQL & SQLite).RedisCachebacked by the officialpackage:redisdriver with TTL (millisecond precision) support.BloomCacheMiddlewarefor route-level HTTP response caching on GET requests with header/path opt-out controls.