Open
Description
Version: 3.2.2
Bug Description
https://forum.nette.org/cs/36236-cache-invalidace-podle-patternu#p225445
$cache1 = new Cache($this->cacheStorage, 1);
$cache2 = new Cache($this->cacheStorage, 2);
$cache1->save("key1-1", "value-1-1", [Cache::Priority => 1]);
$cache2->save("key2-1", "value-2-1", [Cache::Priority => 1]);
$cache1->clean([
Cache::Priority => 1
]);
Assert::null($cache1->load("key1-1"));
Assert::notNull($cache2->load("key2-1")); // Tester\AssertException: Value should not be null
Expected Behavior
Cache1 should not be involved in cleaning of Cache2 - since they have different namespace.
Possible Solution
Problem lies when both caches shares same Storage. Storage returns simply keys without respect to namespace. Namespace should probably be stored in cache storage and cleaning function should pay respect to that namespace.
Metadata
Metadata
Assignees
Labels
No labels