Fixed bug #11285: functions flushByTag and flushByTags in caching framework are very...
authorRupert Germann <rupi@gmx.li>
Tue, 9 Jun 2009 20:53:31 +0000 (20:53 +0000)
committerRupert Germann <rupi@gmx.li>
Tue, 9 Jun 2009 20:53:31 +0000 (20:53 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5576 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php

index 9b71a1b..3d9951c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-09  Rupert Germann  <rupi@gmx.li>
+
+       * Fixed bug #11285: functions flushByTag and flushByTags in caching framework are very unefficient
+
 2009-06-09  Oliver Hader  <oliver@typo3.org>
 
        * Added feature #11302: Add possibility to trigger removal of frontend session data of the current session
@@ -10,7 +14,7 @@
 
        * Fixed bug #11033: Optimize hook to indexed_search that checks for a running crawler task
        * Fixed bug #11268: Optimize initialization of frontend editing
-       * Follow-up to bug #10231: Fixed wrong pattern conversions from split() to preg_split() 
+       * Follow-up to bug #10231: Fixed wrong pattern conversions from split() to preg_split()
 
 2009-06-08  Steffen Kamper  <info@sk-typo3.de>
 
@@ -20,6 +24,7 @@
        * Fixed bug #10741: Create version of page crashes in Cache caused by "-" in const PATTERN_ENTRYIDENTIFIER
 
 2009-06-07  Rupert Germann  <rupi@gmx.li>
+
        * Fixed bug #0011288: function tslib_fe->setPageCacheContent() removes page_cache entry twice
        * Fixed bug #0011289: t3lib_cache_backend_FileBackend doesn't work properly with TYPO3 running in a subdirectory to the document root (thanks to Niels Pardon )
        * followup to #11260: normalized the boolean parameter $reportDocTag before adding it to the md5 hash string
index 568e67a..fd26b2a 100644 (file)
@@ -218,12 +218,12 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
         *
         * @param string The tag the entries must have
         * @return void
-        * @author Ingo Renner <ingo@typo3.org>
         */
        public function flushByTag($tag) {
-               foreach ($this->findIdentifiersByTag($tag) as $entryIdentifier) {
-                       $this->remove($entryIdentifier);
-               }
+               $GLOBALS['TYPO3_DB']->exec_DELETEquery(
+                       $this->cacheTable,
+                       $this->getListQueryForTag($tag)
+               );
        }
 
        /**
@@ -231,12 +231,17 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
         *
         * @param array The tags the entries must have
         * @return void
-        * @author Ingo Renner <ingo@typo3.org>
         */
        public function flushByTags(array $tags) {
-               foreach ($this->findIdentifiersByTags($tags) as $entryIdentifier) {
-                       $this->remove($entryIdentifier);
+               $tmpListQuery = array();
+               foreach ($tags as $tag) {
+                       $tmpListQuery[$tag] = $this->getListQueryForTag($tag);
                }
+               $listQuery = implode(' OR ',$tmpListQuery);
+               $GLOBALS['TYPO3_DB']->exec_DELETEquery(
+                       $this->cacheTable,
+                       $listQuery
+               );
        }
 
        /**