Skip to content

Commit

Permalink
[TASK] #112 - add cache tag for product controller actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Lorenz committed Jun 15, 2017
1 parent 2defbc7 commit 16cf4af
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
3.11.0
2017-06-15
Daniel Lorenz <daniel.lorenz@extco.de>

* TASK #112: add cache tag for product controller actions

3.10.0
2017-06-15
Daniel Lorenz <daniel.lorenz@extco.de>
Expand Down
11 changes: 11 additions & 0 deletions Classes/Controller/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ protected function initializeAction()
$this->searchArguments = $arguments['search'];
}
}

if (!empty($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE'])) {
static $cacheTagsSet = false;

/** @var $typoScriptFrontendController \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
$typoScriptFrontendController = $GLOBALS['TSFE'];
if (!$cacheTagsSet) {
$typoScriptFrontendController->addCacheTags(['tx_cart']);
$cacheTagsSet = true;
}
}
}

/**
Expand Down
19 changes: 19 additions & 0 deletions Documentation/AdministratorManual/Configuration/Caching/Index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
Caching
=======

Für alle Actions des ProductControllers wird ein eigener Cache Tag gesetzt. Dieser kann dazu genutzt werden, gezielt den
Cache aller Seiten mit einem Produkt Plugin zu leeren.

PageTS:

::

# clearCacheCmd for product folder with page id 35
[globalVar = TSFE:id=35]
TCEMAIN.clearCacheCmd = cacheTag:tx_cart
[end]
1 change: 1 addition & 0 deletions Documentation/AdministratorManual/Configuration/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ Konfiguration
AjaxConfiguration/Index
PdfConfiguration/Index
ServiceAttributeConfiguration/Index
Caching/Index
12 changes: 12 additions & 0 deletions Documentation/Misc/Changelog/3.11.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
3.11.0 - 15.06.2017
-------------------

Diese Version setzt für alle Actions des ProductControllers einen eigenen Cache Tag. Dieser kann genutzt werden, um
gezielt den Cache von Seiten zu löschen auf denen Produkte angezeigt werden.

siehe: `Caching <../../AdministratorManual/Configuration/Caching/Index.html>`__
1 change: 1 addition & 0 deletions Documentation/Misc/Changelog/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ChangeLog
:maxdepth: 5
:titlesonly:

3.11.0
3.1.0
3.0.0
2.4.0
Expand Down
1 change: 0 additions & 1 deletion Documentation/Misc/Todos/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Todos
=====

* Kommentare in die E-Mail und Bestellungen übernehmen.
* Modul Bestellungen: Änderung des Status für Zahlung oder Versand im Backend-Modul ermöglichen.
* Daten von eingeloggten Frontend Usern in die Adresse übernehmen.
* Daten der Contacts-Erweiterung in die Adresse übernehmen.
* Modul Bestellstatistik: Ausgabe überarbeiten.
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'description' => 'Shopping Cart(s) for TYPO3',
'category' => 'plugin',
'shy' => false,
'version' => '3.10.0',
'version' => '3.11.0',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
Expand Down

0 comments on commit 16cf4af

Please sign in to comment.