Issue Bug Closed

#41801TypoScript browser conditions don't generate Vary: User-Agent header

Andreas Mayer 10/09/12, 17:42 updated 12/13/14, 23:03

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.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.