Closed bkdotcom closed 6 years ago
Nice catch! I fixed this, though slightly different than what you suggested: if new data is added to collections, it can also lead to evictions in the parent. That is fair game, IMO: other cache backends will also evict whatever they deem necessary, regardless of whether it's in a parent or child (these collections are mostly artificial anyway, implemented via prefixing - they're not separate cache servers) En plus: it's not about data persistence (especially not in a "memory store") - it's ok for data to fall out of cache (a cache eviction is just meant to prevent the app from blowing up if one attempts to store too much data)
Awesome!
MatthiasMullie\Scrapbook\Adapters\Collections\MemoryStore
also needs to extend flush()
der... was thinking that flush should also update $size... but nothing is actually immediately "evicted"... related to #30
MemoryStore limit enforcement goes out the window when collections are created