Project

General

Profile

Actions

Bug #99333

open

Lazy cache clearing in \TYPO3\CMS\Extbase\Core\Bootstrap::clearCacheOnError()

Added by Christoph Lehmann over 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Caching
Start date:
2022-12-10
Due date:
% Done:

0%

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

Description

The Extbase setting enableAutomaticCacheClearing is enabled by default. It leads to clearing the cache when the errorAction() in an Extbase Controller is called.

In \TYPO3\CMS\Extbase\Mvc\Controller\ActionController::errorAction() the status code 400 is returned.

In \TYPO3\CMS\Extbase\Core\Bootstrap::handleFrontendRequest() this leads to clearing the cache for the current page.

        if ($response->getStatusCode() === 400) {
            $this->clearCacheOnError();
        }

The lazy part is in \TYPO3\CMS\Extbase\Core\Bootstrap::clearCacheOnError(), here the page cache is cleared for the (whole) current page

$this->cacheService->clearPageCache([$GLOBALS['TSFE']->id]);

Given I'm on a "detail page" - imagine a news detail page, one page with many cache versions - the cache is cleared for all versions.

Better (correct) would be, to clear the page cache, based on a cache tag produced by \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::createHashBase()

No data to display

Actions

Also available in: Atom PDF