[TYPO3-mvc] Caching problem with start page content rendered through an Extbase Extension

Nico Owassapian owa at gmx.net
Thu Apr 24 19:30:54 CEST 2014


Hi Felix.

Problem was (is?):
The start page plugin checked as first step a GET param (e.g. tx_myext_myplugin[category]). 
If no category param was given, it took a predefined default category for the further processing and rendering of the output.
If a category param is given, the corresponding output will be generated.

Every call through a Typo3-rendered link with a correct cHash (to different categories) worked.
Sometimes - after clearing of cache in BE - the call of the domain/page through www.domain.com (without any GET parameters) delivered the content of some category - instead of the default category content which is selected in the action.

Workaround (no solution) in the corresponding action of the controller:
In the start page plugin now I still check as first step the existence of the GET param category.
But if no one is found I build a new link ($this->uriBuilder->uriFor() : class Tx_Extbase_MVC_Web_Routing_UriBuilder, function uriFor) with the default category as argument and redirect to this URI.

set params:
 $actionName = $this->request->getControllerActionName();
 $controllerName = $this->request->getControllerName();
 $extensionName = $this->request->getControllerExtensionName();
 $pluginName = $this->request->getPluginName();
 $optionalArgumentsArray = array();
 $optionalArgumentsArray['category'] = intval($defaultCategory);

build link for redirect:
 $redirectLink = $this->uriBuilder->uriFor($actionName, $optionalArgumentsArray, $controllerName, $extensionName, $pluginName);

do the redirect:
$this->redirectToURI($redirectLink);

..

But I'm still interested to find a solution/best-practice advice for this problem.

Regards,
Nico



More information about the TYPO3-project-typo3v4mvc mailing list