6 ms·
They're called quality values because they're intended to negotiate the tradeoff between different ways to serve the same content in different formats of varyin
by yorwba 3y ago
They're called quality values because they're intended to negotiate the tradeoff between different ways to serve the same content in different formats of varying quality, e.g. highly compressed JPEG with artifacts vs lossless PNG.
Applying this to Accept-Language, "de,en;q=0.8" means "I prefer German content unless it's less than 80% as good as the English alternative."
Of course in practice servers tend to treat all content they have as quality 1 and all content they don't have as quality 0 and then the lovingly crafted fractional quality values collapse to a simple ordered list. ("We serve what we have and you eat what you get.")
- jazzyjackson 3y agoI had to check the standard [0] on this and there seems to be some ambiguity, maybe simply with usage vs intent. The MDN entry states it is simply priority or preference [1] "12.4.2. Quality Values The content negotiation fields defined by this specification use a common parameter, named "q" (case-insensitive), to assign a relative "weight" to the preference for that associated kind of content. This weight is referred to as a "quality value" (or "qvalue") because the same parameter name is often used within server configurations to assign a weight to the relative quality of the various representations that can be selected for a resource." [0] https://www.rfc-editor.org/rfc/rfc9110.html#quality.values https://www.rfc-editor.org/rfc/rfc9110.html#quality.values [1] https://developer.mozilla.org/en-US/docs/Glossary/Quality_values https://developer.mozilla.org/en-US/docs/Glossary/Quality_va...