From 404d0ed34dfc0fe4700d5d816a3cdc598d577518 Mon Sep 17 00:00:00 2001 From: Andi Date: Mon, 12 Oct 2026 16:57:44 +0200 Subject: [PATCH] fix(htaccess): read config.sendCacheHeaders without TSFE on TYPO3 v14 $GLOBALS['TSFE'] no longer exists in TYPO3 v14 (#107831), so HtaccessGenerator always resolved sendCacheControlHeader to false and the generated .htaccess lost its mod_expires block. Read the setting from the frontend TypoScript of the current request instead. --- Classes/Generator/HtaccessGenerator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Classes/Generator/HtaccessGenerator.php b/Classes/Generator/HtaccessGenerator.php index 42e6afe60ab..916d5ca2522 100644 --- a/Classes/Generator/HtaccessGenerator.php +++ b/Classes/Generator/HtaccessGenerator.php @@ -31,7 +31,8 @@ public function generate(GeneratorCreate $generatorCreateEvent): void $contentType = $matches[0]; } - $sendCacheControlHeader = isset($GLOBALS['TSFE']->config['config']['sendCacheHeaders']) ? (bool) $GLOBALS['TSFE']->config['config']['sendCacheHeaders'] : false; + $frontendTypoScript = ($GLOBALS['TYPO3_REQUEST'] ?? null)?->getAttribute('frontend.typoscript'); + $sendCacheControlHeader = $frontendTypoScript instanceof FrontendTypoScript && (bool) ($frontendTypoScript->getConfigArray()['sendCacheHeaders'] ?? false); $variables = [ 'contentType' => $contentType,