Comment by boomlinde
11 hours ago
RFC 3282 allows for the exclusion of the quality value, in which case the languages are just given in priority order. Removing that will shave some entropy off.
I have a hard time figuring out why quality values are even included for Accept-Language. They either have one of the preferred values, or they don't.
The quality values here seem pretty generically tied to the order, so shaving them off probably wouldn't help? I presume they are there at all to let you express ties?
It seems so, but I don't know that all browsers map quality values to order of preference in the same way.
I don't know about expressing ties. If there really is a tie and the client is just as happy to receive either language of equal Q, then it doesn't matter to the client that one is consistently preferred over another. Perhaps it could matter to the server if e.g. the client indicated that "en" and "zh" are tied, but the "en" content can be served in fewer bytes than it can serve the "zh" content, but it seems like such a niche use case.
edit: RFC 9110 offers an explanation: "Note that some recipients treat the order in which language tags are listed as an indication of descending priority, particularly for tags that are assigned equal quality values (no value is the same as q=1). However, this behavior cannot be relied upon. For consistency and to maximize interoperability, many user agents assign each language tag a unique quality value while also listing them in order of decreasing quality."
re: ties, often a page has "main" language(s) with more content, and translated version with just the basics. If you speak both you probably want the former. Actually for me often I need to go to the German version of a site rather than English to get what I'm looking for, contra my stated preferences... Localisation is a mess.
1 reply →