From 2b7e7c9c887395a4a2b19441cd40d114f53a9c44 Mon Sep 17 00:00:00 2001
From: Benjamin Rannow <b.rannow@familie-redlich.de>
Date: Mon, 6 Nov 2017 12:58:49 +0100
Subject: [PATCH] [TASK] Filter duplicate cache commands from CacheQueue

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/54569
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 typo3/sysext/core/Classes/DataHandling/DataHandler.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/typo3/sysext/core/Classes/DataHandling/DataHandler.php b/typo3/sysext/core/Classes/DataHandling/DataHandler.php
index f3a3e1f86dd4..3d049826bf01 100644
--- a/typo3/sysext/core/Classes/DataHandling/DataHandler.php
+++ b/typo3/sysext/core/Classes/DataHandling/DataHandler.php
@@ -8335,6 +8335,8 @@ class DataHandler implements LoggerAwareInterface
         $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);
-- 
GitLab