mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
Add cache busting via save method of collection repository
This commit is contained in:
@@ -55,7 +55,7 @@ final class CachedCollectionRepository implements CollectionRepository
|
||||
*/
|
||||
public function findAll()
|
||||
{
|
||||
$cacheKey = hash('sha256', $this->cacheKey . '.findAll');
|
||||
$cacheKey = hash('sha256', $this->cacheKey);
|
||||
/** @var \collection[] $collections */
|
||||
$collections = $this->cache->fetch($cacheKey);
|
||||
|
||||
@@ -86,6 +86,15 @@ final class CachedCollectionRepository implements CollectionRepository
|
||||
return null;
|
||||
}
|
||||
|
||||
public function save(\collection $collection)
|
||||
{
|
||||
$this->repository->save($collection);
|
||||
|
||||
$cacheKey = hash('sha256', $this->cacheKey);
|
||||
|
||||
$this->cache->delete($cacheKey);
|
||||
}
|
||||
|
||||
private function putInCache($key, $value)
|
||||
{
|
||||
$this->cache->save($key, $value);
|
||||
|
Reference in New Issue
Block a user