Bug #41801
closedTypoScript browser conditions don't generate Vary: User-Agent header
0%
Description
Conditions that depend on HTTP headers like
[browser = xxx]
should generate a corresponding Vary header, in this case:
Vary: User-Agent
because otherwise, caching with proxies doesn't work.
Steps to reproduce:
1. Make two different page versions, one for IE and one for other browsers. The generated output is selected by TypoScript conditions.
2. An IE user requests the page through a proxy. The proxy gets the IE version of the page and stores it.
3. A non-IE user requests the page through the same proxy.
Result:
The non-IE user gets the cached IE version.
Expected result:
The non-IE user should get the correct version.
Workaround:
Add this to your TypoScript setup when you use [browser] conditions:
config.additionalHeaders = Vary: User-Agent
(More than one Vary header is allowed because they get concatenated to a list, see RFC 2616.)
Preferred solution:
The Typo3 core should add Vary headers automatically as soon as HTTP-header dependent conditions are used.
Related information:
http://www.ninthavenue.com.au/blog/internet-explorer-meets-the-vary-header
However, I think this is only related to old Internet Explorers; maybe there should be a config switch to DISABLE the automatic Vary headers, but not to enable because this is expected by the HTTP RFC.