quality degradation factor for the features attribute, see
section 6.4 of [2].
As an example, if a variant list contains the variant description
{"paper.html.en" 0.7 {type text/html} {language fr}}
and if the request contains the Accept- headers
Accept: text/html:q=1.0, */*:q=0.8
Accept-Language: en;q=1.0, fr;q=0.5
the remote variant selection algorithm will compute an overall
quality for the variant as follows:
{"paper.html.fr" 0.7 {type text/html} {language fr}}
| | |
| | |
V V V
round5 ( 0.7 * 1.0 * 0.5 ) = 0.35000
RFC 2296 HTTP RVSA/1.0 March 1998
With the above Accept- headers, the complete variant list
{"paper.html.en" 0.9 {type text/html} {language en}},
{"paper.html.fr" 0.7 {type text/html} {language fr}},
{"paper.ps.en" 1.0 {type application/postscript} {language en}}
would yield the following computations:
round5 ( qs * qt * qc * ql * qf ) = Q
--- --- --- --- --- -------
paper.html.en: 0.9 * 1.0 * 1.0 * 1.0 * 1.0 = 0.90000
paper.html.fr: 0.7 * 1.0 * 1.0 * 0.5 * 1.0 = 0.35000
paper.ps.en: 1.0 * 0.8 * 1.0 * 1.0 * 1.0 = 0.80000
3.4 Definite and speculative quality values
A computed overall quality value can be either definite or
speculative. An overall quality value is definite if it was computed
without using any wildcard characters '*' in the Accept- headers, and
without the need to use the absence of a particular Accept- header.
An overall quality value is speculative otherwise.
As an example, in the previous section, the quality values of
paper.html.en and paper.html.fr are definite, and the quality value
of paper.ps.en is speculative because the type application/postscript
was matched to the range */*.
Definiteness can be defined more formally as follows. An overall
quality value Q is definite if the same quality value Q can be
computed after the request message is changed in the following way:
1. If an Accept, Accept-Charset, Accept-Language, or
Accept-Features header is missing from the request, add this
header with an empty field.
2. Delete any media ranges containing a wildcard character '*'
from the Accept header. Delete any wildcard '*' from the
Accept-Charset, Accept-Language, and Accept-Features headers.
As another example, the overall quality factor for the variant
{"blah.html" 1 {language en-gb} {features blebber [x y]}}
is 1 and definite with the Accept- headers
Accept-Language: en-gb, fr
Accept-Features: blebber, x, !y, *
RFC 2296 HTTP RVSA/1.0 March 1998
and
Accept-Language: en, fr
Accept-Features: blebber, x, *
The overall quality factor is still 1, but speculative, with the
Accept- headers
Accept-language: en-gb, fr
Accept-Features: blebber, !y, *
and
Accept-Language: fr, *
Accept-Features: blebber, x, !y, *
=3= |