Issue Bug Under Review Quiet

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

Christoph Lehmann 12/10/22, 19:25 updated 10/09/26, 19:42

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()

Reviews 1

History 01