Project

General

Profile

Actions

Bug #90905

closed

cObject caching does not respect TSFE->no_cache

Added by Markus Klein about 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Caching
Target version:
-
Start date:
2020-03-31
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

Actions #1

Updated by Gerrit Code Review about 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

Actions #2

Updated by Gerrit Code Review about 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

Actions #3

Updated by Markus Klein about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by Gerrit Code Review about 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

Actions #5

Updated by Markus Klein about 4 years ago

  • Status changed from Under Review to Resolved
Actions #6

Updated by Benni Mack almost 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF