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 #1

Updated by Steffen Gebert over 11 years ago

  • Status changed from New to Needs Feedback

Sounds really not so easy. Do you know, if this has been fixed in recent IE versions?

We could implement that for conditions based on languages, too. But I'm not sure, if it's so useful, if we directly introduce an option to disable it.

Actions #2

Updated by Andreas Mayer over 11 years ago

According to [[http://blogs.msdn.com/b/ieinternals/archive/2009/06/17/vary-header-prevents-caching-in-ie.aspx]], IE6 ignores Vary: User-Agent (but only if no other Vary headers are set), and has issues with compression. Same for IE7, but when ETags are sent (Typo3 sendCacheHeaders), the problem is much smaller. I couldn't find anything about IE8.

At least IE9+ seems to ignore the Vary: User-Agent header [[http://blogs.msdn.com/b/ie/archive/2010/07/14/caching-improvements-in-internet-explorer-9.aspx]] which would be OK for use with Typo3 (because the header is only relevant for proxys).

If conditions that evaluate Accept-Language are used, "Vary: Accept-Language" should also be sent.

Actions #3

Updated by Alexander Opitz almost 11 years ago

Hi,

as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.1)?

Actions #4

Updated by Andreas Mayer almost 11 years ago

Alexander Opitz wrote:

as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.1)?

Yes, this issue is still present in 6.1.

Actions #5

Updated by Alexander Opitz almost 11 years ago

  • Status changed from Needs Feedback to New
Actions #6

Updated by Georg Ringer over 9 years ago

  • Status changed from New to Closed
  • Is Regression set to No

since 7.0 the support for browser conditions has been dropped with #60574.

therefore this issue is being closed!

Actions

Also available in: Atom PDF