﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18191	Don't consider Accept-Language when generating a cache key	choongmin@…	Łukasz Langa	"Currently, Django makes different cache keys for different Accept-Language headers. But different Accept-Language headers may be resolved into the same language. For example, see the following Accept-Language headers collected in my site for last 30 minutes:

* en-us
* en-US
* en-US,en;q=0.8
* en-US,en;q=0.8,ko;q=0.6
* fr-fr
* ja-JP
* ko
* ko, en
* ko-kr
* ko-KR
* ko-KR, en-US
* ko-kr,ko;q=0.8,en-us;q=0.5,en;q=0.3
* ko-KR,ko;q=0.8,en-US;q=0.6,en;q=0.4
* ko;q=1.0,en;q=0.5

It makes the cache system inefficient for multilingual sites. Since there is utils.cache._i18n_cache_key_suffix, it is unnecessary and redundant to include Accept-Language headers in a cache key. We should ignore them in utils.cache.learn_cache_key.

Note that not adding ""Vary: Accept-Language"" from the first place in middleware.locale.process_response is not a good solution because of proxy servers.

The attached patch removes Accept-Language from headerlist before generating a cache key.

If the patch is rejected, users like me should at least be able to ignore them."	New feature	closed	Core (Cache system)	dev	Normal	fixed	cache vary i18n		Accepted	1	1	1	1	1	0
