Project

General

Profile

Actions

Bug #41801

closed

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

Added by Andreas Mayer over 11 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-10-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #60574: Deprecate all client related condition matchersClosed2014-07-25

Actions
Actions

Also available in: Atom PDF