Skip to content

Commit 4413803

Browse files
committed
FEATURE: Pass tags to be flushed to cache backend
Instead of calling the cache backend for each tag to flush individually, the list of tags is passed to the backend with the newly introduced `flushByTags` method in neos/flow-development-collection#2718. This allows each type of backend to optimise the flushing of all tags, which can lead to huge performance improvements. Especially when content is published to the live workspace which leads to large numbers of cache tags that will be flushed.
1 parent 55fe7da commit 4413803

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Classes/Core/Cache/ContentCache.php

+11
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,17 @@ public function flushByTag($tag)
382382
return $this->cache->flushByTag($this->sanitizeTag($tag));
383383
}
384384

385+
/**
386+
* Flush content cache entries by tags
387+
*
388+
* @param array<string> $tags values that were assigned to a cache entry in Fusion, for example "Everything", "Node_[…]", "NodeType_[…]", "DescendantOf_[…]" whereas "…" is the node identifier or node type respectively
389+
* @return integer The number of cache entries which actually have been flushed
390+
*/
391+
public function flushByTags(array $tags): int
392+
{
393+
return $this->cache->flushByTags($this->sanitizeTags($tags));
394+
}
395+
385396
/**
386397
* Flush all content cache entries
387398
*

0 commit comments

Comments
 (0)