#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 <span data-processor="relativetime" data-value="2025-10-28T15:15:33+00:00" > 10/28/25, 15:15 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 91312 status
NewUnder Review <span data-processor="relativetime" data-value="2025-10-28T15:18:36+00:00" > 10/28/25, 15:18 </span> -
Gerrit Code Review pushed patch set 2 for main to change 91312 <span data-processor="relativetime" data-value="2025-11-11T11:14:26+00:00" > 11/11/25, 11:14 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 91312 <span data-processor="relativetime" data-value="2025-11-11T15:00:20+00:00" > 11/11/25, 15:00 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 91312 <span data-processor="relativetime" data-value="2025-11-11T15:47:09+00:00" > 11/11/25, 15:47 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 91312 <span data-processor="relativetime" data-value="2025-11-11T15:53:14+00:00" > 11/11/25, 15:53 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 91312 <span data-processor="relativetime" data-value="2026-01-23T00:51:39+00:00" > 01/23/26, 00:51 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 93001 <span data-processor="relativetime" data-value="2026-02-25T20:54:00+00:00" > 02/25/26, 20:54 </span>
-
Peter Kraume commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-02-25T21:00:11+00:00" > 02/25/26, 21:00 </span> -
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-03-31T09:00:48+00:00" > 03/31/26, 09:00 </span>
Applied in changeset commit:1cb5d2f1d6247aec2b1392c58083500ccc496e68.