[FEATURE] Provide flushing cache by table and record tags 35/19235/2
authorNicole Cordes <typo3@cordes.co>
Sun, 24 Mar 2013 01:56:48 +0000 (02:56 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Thu, 28 Mar 2013 07:18:39 +0000 (08:18 +0100)
As suggested in the wiki it is helpful to tag caches with a combination of
table and record uid to get the cache deleted when the specific record was
edited. But rather that each extension provides its own implementation it
would be better to store this simple function into the core.

Change-Id: I4fb6b49a913d5e428ae2858d0d0a31dc641d2be3
Resolves: #46617
Releases: 6.1
Reviewed-on: https://review.typo3.org/19235
Reviewed-by: Philipp Gampe
Reviewed-by: Steffen Ritter
Reviewed-by: Anja Leichsenring
Reviewed-by: Stefan Neufeind
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Tested-by: Steffen Ritter
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index ba03d6e..a9d8768 100644 (file)
@@ -6646,6 +6646,9 @@ class DataHandler {
                                                        $GLOBALS['typo3CacheManager']->flushCachesByTag('pageId_' . $pageId);
                                                }
                                        }
+                                       // Delete cache for current table and record
+                                       $GLOBALS['typo3CacheManager']->flushCachesByTag($table);
+                                       $GLOBALS['typo3CacheManager']->flushCachesByTag($table . '_' . $uid);
                                }
                        }
                        // Clear cache for pages entered in TSconfig: