This Problem occurs sporadically on Pages with a large Number of visitors. Sometimes TYPO3 displays the content of a completely different page (including the HTML head Section).
For example, if the user calls the following page: /products/
(default Controller ProductController
with listAction
) TYPO3 shows the content of a random Controller and action of the same Plugin on the Page (like ApplicationController
with showAction
). The Site does not redirect to another Page, it's just showing wrong content!
I already tried the following things:
nonCacheableControllerActions
(Problem occurs a day later again)?no_cache=1
to the URL (Problem is solved, but the page speed is reduced)Does anybody else have the same Problem?
Specifications:
7.6.22
2.2.1
Those caching problems are usually because of wrong or missing cHash.
You can use $GLOBALS['TSFE']→reqCHash();
in your controller's actions. This disables Caching if no cHash is set, therefore making sure you don't get incorrect cache entries. Please note: If you set [pageNotFoundOnCHashError] = 1 in your system settings you will get page not found errors when the page is called without cHash, if it's set to 0 the page will still be displayed but not cached.
Alternatively, there is a system parameter "[FE][cHashRequiredParameters]" - you can add your plugin parameters there. If no cHash is given but one of the parameters are set, then TYPO3 triggers the configured cHash Error behaviour. I believe cHashes are then set automatically for typolinks, you can try and see though. If they aren't set automatically you should set "useCacheHash = 1" on your links to the show action.
I prefer & use the first variant.
Try defining the plugin as USER_INT. plugin.tx_yourextkey = USER_INT
This will tell TYPO3 to render the code for each request.
Best practice would be a second page for the showAction, and only on the single_view page, define the plugin as USER_INT.
But is you have two pages for this you should not experience this problem. And not need the USER_INT setting.
Since TYPO3 v9, use the following:
$TYPO3_CONF_VARS['FE']['cacheHash']['requireCacheHashPresenceParameters']
with an array as value instead of
$TYPO3_CONF_VARS['FE']['cacheHash']['cHashRequiredParameters']
with a comma-separated list.