Last modified: 2013-06-18 15:59:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T23672, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21672 - Accept-Language is missing in Vary header when it's used to find out user's preferred variant
Accept-Language is missing in Vary header when it's used to find out user's p...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Language converter (Other open bugs)
1.16.x
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-28 17:33 UTC by Liangent
Modified: 2013-06-18 15:59 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Add Accept-Language to Vary header (1.91 KB, patch)
2009-11-28 17:33 UTC, Liangent
Details
Add all available variants to Accept-Language in XVO (3.71 KB, patch)
2009-11-29 07:19 UTC, Liangent
Details

Description Liangent 2009-11-28 17:33:02 UTC
Created attachment 6831 [details]
Add Accept-Language to Vary header

It can cause some problems when responses are cached by squid etc.
Comment 1 Roan Kattouw 2009-11-28 17:48:09 UTC
Why did you change the case in Accept-Encoding to accept-encoding (same for Cookie)? I'm not sure if these headers are case-sensitive, but it's best to leave them in their current case. Also, for this to work, OutputPage::getXVO() would have to be changed. Finally, the idea of adding this option inside LanguageConverter doesn't look optimal to me, but I'm not familiar enough with this code to come up with a better idea offhand.
Comment 2 Liangent 2009-11-28 17:54:20 UTC
HTTP header names seem to be case-insensitive ( see http://tools.ietf.org/html/rfc2616#section-4.2 ). I changed the case to avoid duplicates. XVO is not a part of HTTP standard, and I know nothing about it... Is it required?
Comment 3 Roan Kattouw 2009-11-28 18:34:59 UTC
XVO stands for X-Vary-Options: , which is a header Squid uses to determine if something is cacheable. However, I don't believe caching multiple versions of the same page and choosing the one to serve based on a header (like Accept-Language) is possible at the moment.
Comment 4 Philip Tzou 2009-11-28 20:03:00 UTC
I have commit this patch to svn with a few changes have been made:
1. Change the lowercase accept-encoding back to Accept-Encoding.
2. Change getXVO() to include the Accept-Language header, base on Tim Starling's note on <http://old.nabble.com/X-Vary-Options-patch-p15349937.html>.
3. Only add Accept-Language when a valid variant has been found out. In zh case, it's about 7 variants.

If I did something wrong, please tell me.
Comment 5 Philip Tzou 2009-11-28 20:04:49 UTC
Oops, about 8 variants: zh-hans, zh-hant, zh-cn, zh-hk, zh-mo, zh-my, zh-sg, zh-tw. But only zh-cn, zh-hk, zh-tw are commonly used.
Comment 6 Philip Tzou 2009-11-28 20:05:55 UTC
Forgot to include rev id: r59522, r59523, and r59527.
Comment 7 Liangent 2009-11-29 07:19:39 UTC
Created attachment 6832 [details]
Add all available variants to Accept-Language in XVO

I don't agree with r59541 (a follow-up) about what the content in X-Vary-Options should be. See my comment there.

Here is my patch. A new way to add stuff to these headers is provided.

I can't find anything about what if no *-contains exists with a single header name...
Comment 8 Sumana Harihareswara 2011-11-10 00:18:37 UTC
+need-review
Comment 9 Sumana Harihareswara 2012-04-17 15:49:21 UTC
Liangent, I'm sorry, but over time trunk has changed such that your patch no longer applies.  If this issue is still a problem, can you update your patch and submit it in Gerrit?  Thanks.
Comment 10 Liangent 2012-11-17 17:04:44 UTC
A similar implementation is already in codebase. Dunno when it was added.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links