Bug #90905
closedcObject caching does not respect TSFE->no_cache
100%
Description
Problem description¶
We have a custom menu generation TS that looks like this
lib.mainMenu = FLUIDTEMPLATE lib.mainMenu { file = EXT:sitesetup/Resources/Private/Partials/Menu.html cache.key.cObject = TEXT cache.key.cObject.value = menu_{TSFE:sys_language_uid}_{TSFE:gr_list} cache.key.cObject.value.insertData = 1 cache.key.replacement { 10 { search = , replace = _ } } }
As you can see the menu will be cached independently of the page cache. (to avoid regenerating this huge menu for every page)
We have the problem that in FE "randomly" the menu suddenly contains access protected pages, although no user is logged in.
Analysis¶
Our analysis shows that the "culprit" is actually ext:solr indexing pages. If the menu cache has been flushed, solr actually generates this wrong content.
Digging deeper revealed that solr is using tsfe->no_cache=1
to avoid caching stuff in general, which is a good choice.
Unfortunately the code-part dealing with the cObject cache does not adhere to this configuration!
We checked all TYPO3 versions v8+.
Solution¶
Listen for tsfe->no_cache
as well in the caching code for cObjects.
Updated by Gerrit Code Review over 4 years ago
- Status changed from Accepted to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64015
Updated by Gerrit Code Review over 4 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63980
Updated by Markus Klein over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 05b886efd9deed1fb05ae216cb65e766dac3c48b.
Updated by Gerrit Code Review over 4 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63981
Updated by Markus Klein over 4 years ago
- Status changed from Under Review to Resolved
Applied in changeset 6b35756c6fb5b19bfdaff11c4af81b3d039acd82.