[TYPO3-english] Re: Extbase/Fluid extension: clear caches for all pages containing a plugin on records data update?

Viktor Livakivskyi invisible.kinder at gmail.com
Wed Apr 1 12:11:22 CEST 2015


Hi, Hagen.

There is another possible solution to your problem.

Since TYPO3 6.x (?) core itslef clears the cache by tags 'tx_tablename', 'tx_tablename_recordUid' every time when a change is made on a record from 'tx_tablename'  [1]. And it is possible to add page tags from within your own plugins.

So, somewhere in your plugin lisAtcion() (or any other action) you may do following:
/** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $typoScriptFrontendController */
$typoScriptFrontendController = $GLOBALS['TSFE'];
$typoScriptFrontendController->addCacheTags(array('tx_smiproducts_domain_model_device'));

And in your singleViewAction($entity) you may do it like this:
/** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $typoScriptFrontendController */
$typoScriptFrontendController = $GLOBALS['TSFE'];
$typoScriptFrontendController->addCacheTags(array('tx_smiproducts_domain_model_device_' . $entity->getLocalizedUid()));

The rest (cache clearing itself) will be done by core.

[1]: https://forum.typo3.org/index.php?t=tree&th=206708&goto=721412&#msg_721412



More information about the TYPO3-english mailing list