super_cache_disk 1.0.0
super_cache_disk: ^1.0.0 copied to clipboard
File-based disk persistence layer for super_cache. Supports custom codecs, SHA-256 integrity checks, and optional gzip compression.
Changelog #
All notable changes to super_cache_disk are documented here.
Releases follow Semantic Versioning.
1.0.0 — 2024-01-01 #
Stable public release. API is frozen.
Changed #
- Version aligned with the rest of the
super_cachefamily. - Documentation improvements across all public symbols.
0.4.0 #
Added #
DiskCache<K,V>— persistent file-per-entry cache:- Each entry stored as
{keyHash}.dat(value bytes) +{keyHash}.meta(JSON sidecar with TTL and SHA-256 checksum). - SHA-256 integrity verification on every read; corrupted entries are treated as a cache miss and deleted automatically.
- Write-back buffer:
putis non-blocking. The value is immediately readable from the in-memory buffer while the disk write is queued. - Sequential write queue via chained futures — writes are serialised
and the queue is fully drained by
dispose(). - Optional gzip compression (
compress: true). - FIFO eviction when
maxEntries(default 500) is exceeded. - Background TTL sweep timer (configurable
sweepInterval). initialize()scans the cache directory for existing entries so previously persisted data is available across app restarts.
- Each entry stored as
JsonCacheCodec<V>— serialisesVvia JSON (Map<String, dynamic>round-trip throughfromJson/toJsonfunctions).StringCacheCodec— UTF-8 codec for plainStringvalues.