#107891Multiple Cache-Control Header
Description
In several of our projects we detected multiple cache-control headers.
This is problematic because it can lead to inconsistent behavior:
Not all proxies, CDNs, or browsers handle this consistently. Some:
- Only use the first header
- Only use the last header
- Combine them correctly
- Throw an error
Example Header:
> ➜ ~ curl -I https://www.domain.tld
> HTTP/2 200
> server: nginx
> date: Tue, 28 Oct 2025 11:07:58 GMT
> content-type: text/html; charset=utf-8
> content-length: 22911
> vary: Accept-Encoding
> content-language: de-DE
> *cache-control: private, no-store*
> strict-transport-security: max-age=31536000; includeSubDomains
> *cache-control: max-age=0*
> expires: Tue, 28 Oct 2025 11:07:58 GMT
> x-ua-compatible: IE=edge
> x-content-type-options: nosniff
> x-xss-protection: 1; mode=block
> x-frame-options: SAMEORIGIN
> referrer-policy: same-origin
> permissions-policy: geolocation=(), camera=(), microphone=(), payment=()
> x-cache-status: MISS
In the TypoScriptFrontendController TYPO3 already defines cache-control: private, no-store
https://github.com/TYPO3/typo3/blob/a81e2d39c61db71af75ba3eb18089f029c9a9009/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php#L470C14-L470C15
And the default .htaccess, which is shipped with TYPO3, adds the second header:
https://github.com/TYPO3/typo3/blob/a81e2d39c61db71af75ba3eb18089f029c9a9009/typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess#L132C63-L132C77
Possible solution:
Add this after the line ExpiresByType text/x-cross-domain-policy "access plus 1 week" :
<FilesMatch "\.(php|html?)$">
ExpiresActive Off
</FilesMatch>Reviews 2
History 310
-
Peter Kraume changed description 10/28/25, 15:15
-
Gerrit Code Review pushed patch set 1 for main to change 91312 status
NewUnder Review 10/28/25, 15:18 -
Gerrit Code Review pushed patch set 2 for main to change 91312 11/11/25, 11:14
-
Gerrit Code Review pushed patch set 3 for main to change 91312 11/11/25, 15:00
-
Gerrit Code Review pushed patch set 4 for main to change 91312 11/11/25, 15:47
-
Gerrit Code Review pushed patch set 5 for main to change 91312 11/11/25, 15:53
-
Gerrit Code Review pushed patch set 6 for main to change 91312 01/23/26, 00:51
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 93001 02/25/26, 20:54
-
Peter Kraume commented and changed status
Under ReviewResolved done0 %100 % 02/25/26, 21:00 -
Benni Mack changed status
ResolvedClosed 03/31/26, 09:00
Applied in changeset commit:1cb5d2f1d6247aec2b1392c58083500ccc496e68.