[TASK] Filter duplicate cache commands from CacheQueue 78/54578/2
authorBenjamin Rannow <b.rannow@familie-redlich.de>
Mon, 6 Nov 2017 11:58:49 +0000 (12:58 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 7 Nov 2017 14:29:40 +0000 (15:29 +0100)
under the right condition multiple duplicate cache commands are executed

for Example: save a record in Backend can course multiple 'pages'
commands will be executed, if the record has inline records.

flushing '20' times the 'pages' cache is unnecessary.

Resolves: #82930
Releases: master, 8.7
Change-Id: I69e581cb7f12acbd8172b2ca88e89f93ebfbe4b4
Reviewed-on: https://review.typo3.org/54578
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 816f3e1..764d10c 100644 (file)
@@ -8449,6 +8449,8 @@ class DataHandler
         $cacheManager = $this->getCacheManager();
         $cacheManager->flushCachesInGroupByTags('pages', array_keys($tagsToClear));
 
+        // Filter duplicate cache commands from cacheQueue
+        $clearCacheCommands = array_unique($clearCacheCommands);
         // Execute collected clear cache commands from page TSConfig
         foreach ($clearCacheCommands as $command) {
             $this->clear_cacheCmd($command);