diff --git a/system/modules/isotope/library/Isotope/Model/ProductCache.php b/system/modules/isotope/library/Isotope/Model/ProductCache.php index 43cc63a1eb..9c95a4693b 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCache.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCache.php @@ -15,6 +15,7 @@ use Contao\FrontendUser; use Contao\Input; use Contao\Model; +use Contao\System; /** * Isotope\Model\ProductCache represents an Isotope product cache model @@ -227,6 +228,10 @@ public static function deleteForPageAndModuleOrExpired($intPage, $intModule) public static function purge() { Database::getInstance()->query("TRUNCATE " . static::$strTable); + + if (System::getContainer()->has('fos_http_cache.cache_manager')) { + System::getContainer()->get('fos_http_cache.cache_manager')->invalidateTags(['contao.db.tl_iso_product']); + } } /** diff --git a/system/modules/isotope/library/Isotope/Module/ProductList.php b/system/modules/isotope/library/Isotope/Module/ProductList.php index 7e380c44c8..11b9b6a014 100755 --- a/system/modules/isotope/library/Isotope/Module/ProductList.php +++ b/system/modules/isotope/library/Isotope/Module/ProductList.php @@ -303,6 +303,12 @@ protected function compile() ; $this->Template->products = $arrBuffer; + + // Add cache tag + if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger')) { + $responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger'); + $responseTagger->addTags(['contao.db.tl_iso_product']); + } } /** diff --git a/system/modules/isotope/library/Isotope/Module/ProductReader.php b/system/modules/isotope/library/Isotope/Module/ProductReader.php index 61094c1a50..ff9da0eace 100755 --- a/system/modules/isotope/library/Isotope/Module/ProductReader.php +++ b/system/modules/isotope/library/Isotope/Module/ProductReader.php @@ -127,6 +127,12 @@ protected function compile() $this->Template->product_class = $objProduct->getCssClass(); $this->Template->referer = 'javascript:history.go(-1)'; $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack']; + + // Add cache tag + if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger')) { + $responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger'); + $responseTagger->addTags(['contao.db.tl_iso_product.'.$objProduct->id]); + } } /**