Skip to content

fix(htaccess): read config.sendCacheHeaders without TSFE on TYPO3 v14 - #475

Merged
lochmueller merged 1 commit into
lochmueller:mainfrom
kraemer-igroup:patch-1
Oct 12, 2026
Merged

lochmueller merged 1 commit into
lochmueller:mainfrom
kraemer-igroup:patch-1

Conversation

@kraemer-igroup

Copy link
Copy Markdown
Contributor

Short description

$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.

Related Issue

Related to #474: also about cache lifetimes in the generated .htaccess on 14.3 / 16.1.2, but with a different cause.

More Details

Tested on TYPO3 14.3, PHP 8.5, Apache: before the fix, GET on a statically cached page returned max-age=0. After the fix, the generated .htaccess contains ExpiresByType text/html M43200 and the page is served with max-age=43199 (config.cache_period = 43200).

$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.
@lochmueller

Copy link
Copy Markdown
Owner

Hey @kraemer-igroup
thanks for finding. Merged. Check the tests later...
Regards,
Tim

@lochmueller
lochmueller merged commit 8864820 into lochmueller:main Oct 12, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants