httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Robert S. Thau)
Subject Re: Problems with Content Negociation (fwd)
Date Thu, 16 May 1996 15:52:41 GMT
  As I've shown, the 
  spec does reccomend that we choose more specific accept types over
  wilcard entries with the same quality value.

A caveat:  "the same quality value" doesn't always mean what one
might want it to mean.  For instance, suppose there are variants of a
given resource available, an image/png variant at qs=0.9 and a
text/plain variant at qs=0.2 (ascii graphics).  Now, if a browser

  Accept: text/html, text/plan, image/xbm, image/gif, image/jpeg, */*

the png variant matches the wildcard, and its superior qs value gives
it a *much* higher aggregate quality rating (q*qs), which causes it to
be sent, even though the browser in this instance probably can't
handle image/png terribly gracefully.  Note that jiggering the final
products by 0.0002 (which is, I *think*, what your patch would do in
this case --- apologies if I misread) would not affect the outcome.

The server really does have to treat wildcards as having a
*substantially* lower q value in order to generate sensible behavior
in these sorts of examples, given what existing browsers actually do

FWIW, in cases where two variants have the exact same *aggregate*
quality rating (q*qs), the existing code has a tiebreaking rule which
favors the first type listed in the Accept: headers, which would give
matches to the wildcard the lowest preference in the cited example,
and in yours.  (This rule is actually implicit in the order in which
the variants are checked, but it's there nonetheless).  There are also
numerous other tie-breaking rules which come into play in this
situation, and preferring exact matches to wildcards might be a good
one to add, but I'm not sure that jiggering the numbers is the best
way to do it.


View raw message