Comment On Mobile Inflation

Thought I'd do a code-free post with a fun tale from Chris Launey, who works in web operations at a large media/entertainment company. While helping the engineers troubleshoot a problem with Cingular devices being unable to visit WAP sites, they discovered that their load balancer would ignore HTTP requests with more than 2000 bytes in the request header. It was fairly trivial to change the upper limit, but they were all a bit mystified at why a mobile phone would send such huge request headers ... [expand full text]
« PrevPage 1 | Page 2Next »

Re: Mobile Inflation

2005-09-13 14:04 • by Maurits
The idea is list preferred MIME-Types earlier in the list.

So isn't this bit backwards?

application/xhtml+xml, application/vnd.wap.xhtml+xml

Re: Mobile Inflation

2005-09-13 14:06 • by richleick
Isn't it just better to be safe than sorry?  Just in case



-- thick sarcasm --

Re: Mobile Inflation

2005-09-13 14:10 • by WTFery
43807 in reply to 43805

hmm..


 you guys must be running out of stuff there.


what you need is to crack open some more vb jokes, oops I mean source.

Re: Mobile Inflation

2005-09-13 14:11 • by John Smallberries
43808 in reply to 43805
What if * gets redefined?

Re: Mobile Inflation

2005-09-13 14:31 • by ak
Yup, the mobile phone industry creates the most braindead software you can imagine, and a lot of mobile phones have bugs that simply make you shake your head.

A good example is the SonyEricsson P-800: if you want to download a wallpaper via a WAP Push message, the P-800 will fail to display it after downloading when the URL isn't static or doesn't end in the filename extension that fits the file format (e.g. when you send a JPEG file, the extension must be .jpg), and it completely ignores the Content-Type header. *argl*

There are many more stories to tell, but if you continued, it would remind me of the old horror stories and make me puke.

Re: Mobile Inflation

2005-09-13 14:36 • by Mung Kee
// need to set the mime type if it hasn't been set yet, we'll accept all mime types
// because there should be no bias.

Re: Mobile Inflation

2005-09-13 14:41 • by makomk
I think he's right - it's because they charge by the kilobyte. Ouch - around 1275 bytes just for one mostly worthless header. How much does *that* cost per request?

Re: Mobile Inflation

2005-09-13 14:43 • by David
43818 in reply to 43816
Mung Kee:
// need to set the mime type if it hasn't been set yet, we'll accept all mime types
// because there should be no bias.


Heh.

Re: Mobile Inflation

2005-09-13 15:13 • by khoker
Hold on a second. Are customers responsible for paying upstream bandwidth as well as downstream? I might be wearing a tinfoil hat, but could this be a way to get an extra $0.02 for *every* request made from the phone?

Re: Mobile Inflation

2005-09-13 15:38 • by chb
I wonder whether there is a switch-statement involved somewhere *shiver*



-- i'm a .sig when i'm big.

Re: Mobile Inflation

2005-09-13 15:55 • by Marc
43828 in reply to 43814
Anonymous:
Yup, the mobile phone industry creates the most braindead software you can imagine, and a lot of mobile phones have bugs that simply make you shake your head.

 

My Kyocera can play every tone on earth except the standard telephone ring! Virgin Mobile refuses to make a teelphone ring available on their web site for free to fix this since they couldn't do this without making it available to everybody.

 

M.

Re: Mobile Inflation

2005-09-13 16:49 • by Stan Rogers
43832 in reply to 43828
Anonymous:
Anonymous:
Yup, the mobile
phone industry creates the most braindead software you can imagine, and
a lot of mobile phones have bugs that simply make you shake your head.

 

My Kyocera can play every tone on earth except the standard
telephone ring! Virgin Mobile refuses to make a teelphone ring
available on their web site for free to fix this since they couldn't do
this without making it available to everybody.

 

M.




... and Lord knows you wouldn't want hundreds of thousands of people
wandering around with telephones that sound like telephones.

Re: Mobile Inflation

2005-09-13 16:50 • by Oliver Klozoff
As someone previously pointed out, the Accept list is supposed to list alternative MIME types in order of preference.

I find it very interesting that on this particular request, the phone most strongly desires a CSS stylesheet file; however, if you don't have one readily available, a JPEG or a MIDI will do just fine.

What are they planning to do? OCR a screenshot of a CSS file, or (failing that) use voice recognition software to grok a recording of someone reading a CSS stylesheet aloud?

Re: Mobile Inflation

2005-09-13 16:51 • by jvancil

but... wouldn't */* be equal to 1?  (Maybe we need the AreEqual function from a couple of days ago to find out...)


WTF


 

Re: Mobile Inflation

2005-09-13 17:09 • by A Nonny Mouse
43836 in reply to 43832
Stan Rogers:
Anonymous:

Anonymous:
Yup, the mobile phone industry creates the most braindead software you can imagine, and a lot of mobile phones have bugs that simply make you shake your head.

 

My Kyocera can play every tone on earth except the standard telephone ring! Virgin Mobile refuses to make a teelphone ring available on their web site for free to fix this since they couldn't do this without making it available to everybody.

 

M.



... and Lord knows you wouldn't want hundreds of thousands of people wandering around with telephones that sound like telephones.


 


I used to think it would be nice to hear mobiles that sounded like phones used to in the good old days. Then one of my colleagues got a mobile that is just a ringing noise. It goes off about 3 times an hour all day. I've gone right off the idea. I also may have to kill him shortly.


 

Re: Mobile Inflation

2005-09-13 17:12 • by David P. Murphy
43837 in reply to 43817
makomk:
I think he's right - it's because they charge by
the kilobyte. Ouch - around 1275 bytes just for one mostly worthless
header. How much does *that* cost per request?




I agree with your cynicism; however, I'm not sure why "Accept: */*" is not considered "entirely worthless".





ok

dpm

Re: Mobile Inflation

2005-09-13 17:13 • by NSCoder
43838 in reply to 43834
jvancil:

but... wouldn't */* be equal to 1?  (Maybe we need the AreEqual function from a couple of days ago to find out...)


WTF


 



Not if *=0 (hey that almost looks like the expression on my face when I saw the WTF). 0/0 is undefined. You can sometimes work out a finite limit as * approaches 0, but the answer depends on exactly how * does so. Which makes */* a nice shorthand for '...and everything else' since it can evaluate to pretty much whatever you want it to. I've never seen it equal a MIME type, but I suppose if they were all just variable names it would work out.

Re: Mobile Inflation

2005-09-13 17:15 • by Omnifarious
43839 in reply to 43833
Oliver Klozoff:
As someone previously pointed out, the
Accept list is supposed to list alternative MIME types in order of
preference.
I find it very interesting that on this particular request, the phone
most strongly desires a CSS stylesheet file; however, if you don't have
one readily available, a JPEG or a MIDI will do just fine. What are
they planning to do? OCR a screenshot of a CSS file, or (failing that)
use voice recognition software to grok a recording of someone reading a
CSS stylesheet aloud?


No, no, that's not it. It's a MIDI file. AFAIK, you can't get voice into that, unless they think someone is going to code it in as instrument patches or something...


No, I bet they generate the CSS by assigning a letter value to each note. ABCDEFG, and I bet the half-tones are assigned punctuation like <>.";:* so people can actually do something with their CSS.


Re: Mobile Inflation

2005-09-13 17:16 • by NSCoder
43840 in reply to 43836
Anonymous said:
I used to think it would be nice to hear mobiles that sounded like phones used to in the good old days. Then one of my colleagues got a mobile that is just a ringing noise. It goes off about 3 times an hour all day. I've gone right off the idea. I also may have to kill him shortly.


I bet you would have already killed him if the phone played some annoying tune, like that bananaphone song for instance.

My phone moofs.

Re: Mobile Inflation

2005-09-13 17:33 • by CornedBee
43841 in reply to 43833
Oliver Klozoff:
As someone previously pointed out, the
Accept list is supposed to list alternative MIME types in order of
preference.


Forgive me, but this is incorrect.

ftp://ftp.isi.edu/in-notes/rfc2616.txt (scroll to page 100)



The definition of the Accept HTTP/1.1 header says that the q parameter
specifies the preference, and that it defaults to 1.0. Thus, if a media
type has no q parameter, its preference is 1.0, no matter where in the
list it occurs. There is an example that explicitely says so.

From this point of view, the WTF becomes even greater, because */* has
exactly the same preference as all other types. In other words,
application/vnd.microsoft.excel is just as fine as text/html.



I have a vague memory, however, of IE not honouring the q= system
correctly and sending an unqualified list in order of preference. So
servers (esp. IIS) might interpret this phone's header as intended.

Re: Mobile Inflation

2005-09-13 18:47 • by Kevin
43843 in reply to 43841
CornedBee:
Oliver Klozoff:
As someone previously pointed out, the
Accept list is supposed to list alternative MIME types in order of
preference.


Forgive me, but this is incorrect.

ftp://ftp.isi.edu/in-notes/rfc2616.txt (scroll to page 100)



The definition of the Accept HTTP/1.1 header says that the q parameter
specifies the preference, and that it defaults to 1.0. Thus, if a media
type has no q parameter, its preference is 1.0, no matter where in the
list it occurs. There is an example that explicitely says so.

From this point of view, the WTF becomes even greater, because */* has
exactly the same preference as all other types. In other words,
application/vnd.microsoft.excel is just as fine as text/html.



I have a vague memory, however, of IE not honouring the q= system
correctly and sending an unqualified list in order of preference. So
servers (esp. IIS) might interpret this phone's header as intended.


The q is for quality, 0 to 1.  Full quality, 1, is the default.  The value was to request lower quality videos or audio samples.  Thus, preference is given to types that will be of full quality.

The order of preference is determined, first by quality, second by specificity (text/html takes precendence over text/*), and third by order they are listed.  In other words, if all types are specific and q= is never used, the first one supported should be selected.

Very few programmes use the q= value these days.  It even says so on page 99 of the RFC.  Right around the "due to historical practice".

Re: Mobile Inflation

2005-09-13 18:57 • by JoeJoe
ININITRY PLUS ONE!!!

Re: Mobile Inflation

2005-09-13 21:10 • by Random Passerby
43846 in reply to 43843
Anonymous:
The q is for quality, 0 to 1.  Full
quality, 1, is the default.  The value was to request lower
quality videos or audio samples.  Thus, preference is given to
types that will be of full quality.
That's completely
wrong.  Quoted from the RFC: "Quality factors allow the user or
user agent to indicate the relative degree of preference for that
media-range, using the qvalue scale from 0 to 1 (section 3.9). The
default value is q=1."  In other words, what is referred to as
"quality" is actually an order of preference.


Anonymous:
The order of preference is determined,
first by quality, second by specificity (text/html takes precendence
over text/*), and third by order they are listed.  In other words,
if all types are specific and q= is never used, the first one supported
should be selected.
While this may be true in practice (I'm
uncertain), it's definitely not how programs are supposed to behave
according to the RFC.  (You're right about the quality and
specificity ordering, but listing order should not be a factor.)



In this example, all the items have the same quality level (1), and all
but the last (*/*) have equal specificity.  So it's basically
saying that it prefers *any* one of the listed media types rather than
some random other thing, but if there's no other option then it'll just
take what its given.



It's still kinda silly, though (unless its being used as a way to
charge more), because only in unbelievably rare cases are servers
actually configured with multiple resource types available from a
single URL.

Re: Mobile Inflation

2005-09-14 00:16 • by foxyshadis
43847 in reply to 43846
Anonymous:
Anonymous:
The q is for quality, 0 to 1.  Full
quality, 1, is the default.  The value was to request lower
quality videos or audio samples.  Thus, preference is given to
types that will be of full quality.
That's completely
wrong.  Quoted from the RFC: "Quality factors allow the user or
user agent to indicate the relative degree of preference for that
media-range, using the qvalue scale from 0 to 1 (section 3.9). The
default value is q=1."  In other words, what is referred to as
"quality" is actually an order of preference.


Anonymous:
The order of preference is determined,
first by quality, second by specificity (text/html takes precendence
over text/*), and third by order they are listed.  In other words,
if all types are specific and q= is never used, the first one supported
should be selected.
While this may be true in practice (I'm
uncertain), it's definitely not how programs are supposed to behave
according to the RFC.  (You're right about the quality and
specificity ordering, but listing order should not be a factor.)



In this example, all the items have the same quality level (1), and all
but the last (*/*) have equal specificity.  So it's basically
saying that it prefers *any* one of the listed media types rather than
some random other thing, but if there's no other option then it'll just
take what its given.



It's still kinda silly, though (unless its being used as a way to
charge more), because only in unbelievably rare cases are servers
actually configured with multiple resource types available from a
single URL.


It's theoretically possible to have a single url feed html, text, rss,
random xml, and anything else off a single url, and I've seen it done,
but the incompatibility factor is so high that it's always easiler to
stick to one-name-one-resource or url query string. That was one of the
places the writers of the RFC had a bit too much faith in the
implementors.



Not sure why more browsers don't just have Accept: */*, it's not like
single-url is going to come into style soon, and they're going to turn
down whatever's given to them.

Re: Mobile Inflation

2005-09-14 01:00 • by Calvin M Spealman
So I'm paying at least two cents for every request, before I even start downloading anything? Wow, I really am getting ripped off.

Re: Mobile Inflation

2005-09-14 03:46 • by Ilpalazzo-sama
43851 in reply to 43827
You just KNOW the code behind that looks something like this:




string strAccept = "Accept: ";

for (float lngCount = 1; lngCount < g_NumTypes; lngCount++) {
switch (lngCount) {
case 1:
strAccept = strAccept + "text/css";
if (lngCount < g_NumTypes) strAccept = strAccept + ", ";
break;
case 1:
strAccept = strAccept + "application/vnd.wap.wmlscriptc";
if (lngCount < g_NumTypes) strAccept = strAccept + ", ";
break;

// and so on ...

default:
strAccept = strAccept + "*/*";
if (lngCount < g_NumTypes) strAccept = strAccept + ", ";
break;
}
}

Re: Mobile Inflation

2005-09-14 03:50 • by Ilpalazzo-sama
43852 in reply to 43851
Stupid forum software...

what I was trying to say was:


string strAccept = "Accept: ";

for (float lngCount = 1; lngCount < g_NumTypes; lngCount++) {
switch (lngCount) {
case 1:
strAccept = strAccept + "text/css";
if (lngCount < g_NumTypes) strAccept = strAccept + ", ";
break;
case 2:
strAccept = strAccept + "application/vnd.wap.wmlscriptc";
if (lngCount < g_NumTypes) strAccept = strAccept + ", ";
break;

// and so on ...

default:
strAccept = strAccept + "*/*";
if (lngCount < g_NumTypes) strAccept = strAccept + ", ";
break;
}
}

Re: Mobile Inflation

2005-09-14 03:51 • by Ilpalazzo-sama
43853 in reply to 43852
Okay, I give up.

Re: Mobile Inflation

2005-09-14 04:04 • by Welcome To The Machine
Alex Papadimoulis:

they were all a bit mystified at why a mobile phone would send such huge request headers ...


That's BRILLANT!


Stupid mobile phone companies - and yes they do charge for upstream as well as downstream, I agree this may be a combination of lazy coding, idiotic overkill and a money making scheme.

Re: Mobile Inflation

2005-09-14 04:35 • by brazzy
43855 in reply to 43851
Apparently this wonderful HTML enditor does not escape angled braces in code blocks. Let me try:



Anonymous:
You just KNOW the code behind that looks something like this:



string strAccept = "Accept: ";

for (float lngCount = 1; lngCount &lt; g_NumTypes; lngCount++) {
switch (lngCount) {
case 1:
strAccept = strAccept + "text/css";
if (lngCount &lt; g_NumTypes) strAccept = strAccept + ", ";
break;
case 1:
strAccept = strAccept + "application/vnd.wap.wmlscriptc";
if (lngCount &lt; g_NumTypes) strAccept = strAccept + ", ";
break;

// and so on ...

default:
strAccept = strAccept + "*/*";
if (lngCount &lt; g_NumTypes) strAccept = strAccept + ", ";
break;
}
}

Re: Mobile Inflation

2005-09-14 08:02 • by Asd
43860 in reply to 43855
Pah, this is the least of the problems with mobile phone browsers. I
can never understand why some phones can't use a linked css file even
though other phones from the same company with the same OS do. Pretty
much every mobile phone browser is broken in some way or other e.g.
nested divs, table support, css support.

Re: Mobile Inflation

2005-09-14 08:09 • by brazzy
43861 in reply to 43860
Anonymous:
Pah, this is the least of the problems with mobile phone browsers. I
can never understand why some phones can't use a linked css file even
though other phones from the same company with the same OS do.



Probably a different version of the browser.



Anonymous:


Pretty
much every mobile phone browser is broken in some way or other e.g.
nested divs, table support, css support.




No surprise. Rendering webpages is extremely difficult to get right due
to the complex mess of the standards, their various extensions and lack
of most pages to actually confirm to any of them. It took the PC
browser makers 10 years to get it mostly right.  And the phone
makers can't use that code because it's way too bloated to run on their
limited-resource devices.

Re: Mobile Inflation

2005-09-14 08:17 • by Ilpalazzo-sama
43862 in reply to 43855
Actually, it did escape the brackets correctly when I first typed my
text, but then I failed the Captcha test and apparently when the forum
software posts the message back for a retry it seems to unescape them
and then forgets to escape them on the final submission. The same
happened both times I tried, even though I was pretty sure I had entered the right word
and no typos...



PS: First captcha attempt failed again just now. 100% certain I entered the correct word. Looks like a bug to me.



PPS: Second try failed, too. Maybe it's a timeout issue? Since the
captcha is generated when the message edit form is displayed, if you
take too long to write or edit the message, it's expired by the time
you get to click on "post" ...

Re: Mobile Inflation

2005-09-14 08:24 • by Xander Lebrun
43863 in reply to 43838
NSCoder:


Not if *=0 (hey that almost looks like the expression on my face when I
saw the WTF). 0/0 is undefined. You can sometimes work out a finite
limit as * approaches 0, but the answer depends on exactly how * does
so. Which makes */* a nice shorthand for '...and everything else' since
it can evaluate to pretty much whatever you want it to. I've never seen
it equal a MIME type, but I suppose if they were all just variable
names it would work out.




But if * is a non-zero element of a field then */* will equal 1, by
definition of division. So how can you have any finite limit of */*s
that doesn't equal 1? Or were you thinking of taking limits of
a/b as a->b?

Re: Mobile Inflation

2005-09-14 09:40 • by me
You're sure that you didn't forgot anything in this way :D

you forgot poland!

2005-09-14 10:29 • by terrbear
43867 in reply to 43866
YOU FORGOT POLAND!

Re: Mobile Inflation

2005-09-14 10:35 • by imajes
a certain OS X browser used to do this... and it frequently tripped certain tripwires... I ended up talking to the CTO about how that was a really pointless thing to do.
:)

Re: Mobile Inflation

2005-09-14 11:17 • by me
how big is your freakin' monitor anway? this page is double the width of mine...

Re: Mobile Inflation

2005-09-14 11:25 • by Eric
43873 in reply to 43871
Yeah, can you guys try to do a better job of making these posts Firefox
(Gecko, actually) freindly? Many of them require lots of horizontal
scrolling which is a big no-no in web design.



Re: Mobile Inflation

2005-09-14 14:37 • by Kevin
43886 in reply to 43846
Anonymous:
Anonymous:
The q is for quality, 0 to 1.  Full
quality, 1, is the default.  The value was to request lower
quality videos or audio samples.  Thus, preference is given to
types that will be of full quality.
That's completely
wrong.  Quoted from the RFC: "Quality factors allow the user or
user agent to indicate the relative degree of preference for that
media-range, using the qvalue scale from 0 to 1 (section 3.9). The
default value is q=1."  In other words, what is referred to as
"quality" is actually an order of preference.




You only read part of that section which states that quality affects preference. But there is a reason why. Quality degradation is undesirable, but generally unavoidable when converting formats, language, etc.


From page 100:

   SHOULD be interpreted as "I prefer audio/basic, but send me any audio

type if it is the best available after an 80% mark-down in quality."




This means "if you cannot give me an audio/basic file, choose whatever format you can give with no more than 80% degradation". Obviously 0% (qvalue of 1) is most desirable.



Check out this post of notes from an IETF meeting that discusses this very topic in more comprehensible language:


http://groups.yahoo.com/group/http-wg/message/7021



(You're right about the quality and
specificity ordering, but listing order should not be a factor.)




The only reason order would be a factor is because the server will typically choose the best match. Quality first, then specificity, then finally, whichever the client requested first.

Re: Mobile Inflation

2005-09-14 14:40 • by Anonymous
43887 in reply to 43873
I was wondering why that first post is all WTFED up.  The rest are
fine for me, it's just that first one that doesn't line wrap
properly. 





Re: Mobile Inflation

2005-09-14 16:24 • by Maurits
43905 in reply to 43887
My interpretation of the RFC is that Accept types should be returned in the following order:

1) Higher q= factor before lower q= factor
No q= defaults to q=1
Valid ranges for q are 0 to 1

2) BETWEEN TYPES WITH THE SAME q= FACTOR:
Higher specificity before lower specificity
text/html;index=1
text/html
text/*
*/*

3) BETWEEN TYPES WITH THE SAME q= FACTOR AND SPECIFICITY:
No further ordering is implied by the RFC

Thus, web servers and user agents are perfectly free, if they wish, to naturally extend the RFC by adding an "order-of-occurrence" tiebreak for entries of the same q= factor and specificity.  Whether this is correct or not is subject to debate.

Re: Mobile Inflation

2005-09-14 18:24 • by foxyshadis
43931 in reply to 43873
Anonymous:
Yeah, can you guys try to do a better job of making these posts Firefox
(Gecko, actually) freindly? Many of them require lots of horizontal
scrolling which is a big no-no in web design.


What makes you think the top post is IE friendly? The only thing it is,
is megamonitor friendly. Would have been nice if a few more line breaks
were added to it.



Be glad it isn't phpbb, which still defaults to a single table, so
EVERY post gets stretched out as much as the widest post. That's the
real BS.

Re: Mobile Inflation

2005-09-14 19:56 • by robbak
43941 in reply to 43817
This really should be brought to the attention of whatever consumer
organizations exist in your country. In a market that charges per byte,
overlong headers are at best a bug, at worst, dishonest.



If you have, or live in a market where these phones are in use, then a
well-formed letter to your consumer advocates is in order.

Re: Mobile Inflation

2005-09-14 21:28 • by Random Passerby
43953 in reply to 43886
Anonymous:
From page 100:

   SHOULD be interpreted as "I prefer audio/basic, but send me any audio
type if it is the best available after an 80% mark-down in quality."
This
means "if you cannot give me an audio/basic file, choose whatever
format you can give with no more than 80% degradation". Obviously 0%
(qvalue of 1) is most desirable.
No, it means "if you cannot
give me an audio/basic file, then give me whatever you have, but I only
consider it 20% as good as an audio/basic".  The actual percentage
is irrelevant in the case where there's only two options, as it's only
used to indicate a preference order.  Note the earlier example
where the items are listed out of preference order -- the order in
which things are listed is NOT SIGNIFICANT.

Anonymous:
Check out this post of notes from an IETF
meeting that discusses this very topic in more comprehensible language:


http://groups.yahoo.com/group/http-wg/message/7021
That's
referring to something entirely different.  Just because both
refer to the word "quality" doesn't mean that the word is being used in
the same sense in both places :)

Re: Mobile Inflation

2005-09-15 07:40 • by Dave
43984 in reply to 43837




I think he's right - it's because they charge by the kilobyte. Ouch - around 1275 bytes just for one mostly worthless header. How much does *that* cost per request?

I agree with your cynicism; however, I'm not sure why "Accept: */*" is not considered "entirely worthless".


ok
dpm

Assuming they are still using WSP, that accept header compresses down quite a bit. IIRC, the byte sequence { 0x80,0x00 }, for instance, is equivalent to "Accept: */*".

Of course, where WSP giveth, WSP taketh away. A single header with multiple values is encoded as header: value1,header: value2,
ad nauseam.

Re: Mobile Inflation

2005-09-15 09:41 • by Kevin
43999 in reply to 43953
Anonymous:
That's
referring to something entirely different.  Just because both
refer to the word "quality" doesn't mean that the word is being used in
the same sense in both places :)


What is it discussing then?  Looks to me like content alternatives in HTTP requests for media type, encoding, and language.  Plus the qvalue usage follows the same pattern.

Also, consider, why else would the qvalue exist?  If the qvalue was *only* for "preference", then why not simply list types in order of preference?  (Which is what the default of no q= does.)  Also, why is it called "quality" instead of something more like what you describe, "preference"?  Seems rather ridiculous to call it "quality" if it means "preference".



O'Reilly writes a less-technical description of HTTP headers. Let's see... Accept-Language: language qvalue.



Multiple languages can be listed separated by commas. The optional qvalue represents, on a scale of 0 to 1, an acceptable quality level for nonpreferred languages. Languages are written with their two-letter abbreviations (e.g., en for English, de for German, fr for French, etc.). See Appendix B for a listing of languages.



"Acceptable quality level for nonpreferred languages"



It's very easy (as you prove) to muddle the point. The quality is not referring to preference, but QUALITY. However, since the number is usually lowest for nonpreferred types, it is common to describe the qvalue as a preference ranking. (Which is pretty much all anyone really used it for anyway.)



   The example


Accept: audio/*; q=0.2, audio/basic

SHOULD be interpreted as "I prefer audio/basic, but send me any audio
type if it is the best available after an 80% mark-down in quality."



How is this supposed to be interpreted any other way than "send me whatever you can convert it to with no more than 80% degradation"?



It's easiest to understand the point when you realise converting anything (encoding, language, media type, etc) will always result in some loss of quality. With the qvalue you were supposed to be able to request conversion not take place if it degrades quality too much.

Re: Mobile Inflation

2005-09-15 13:30 • by primarily_defence
44043 in reply to 43816
Mung Kee:
// need to set the mime type if it hasn't been set yet, we'll accept all mime types
// because there should be no bias.




Congratualtions, you were just now a victim of a drive-by JEDism :P

Re: Mobile Inflation

2005-09-15 13:36 • by Ralp
44045 in reply to 43999
Hi,

content negotiation q-values as sent in a user agent's request headers
are used to help the server decide what type of file to serve. 
That is, they are just preference rankings; they do not expect the
server to do any sort of conversion.  For instance, "Accept:
image/png, image/gif; q=0.8" just means we would rather have a png
instead of a gif, in case the server has more than one format of the
image resource at the requested URI.

The server can also store its own q values.  For instance, if we
have both application/xhtml+xml and text/html versions of a document at
a URI, we would probably prefer to serve the former, so let's say we
decide mark down the quality of the latter to 0.7.

Now say a request comes in to our server from a user agent that would
rather just have plain text, but can handle html or xhtml, so it sends
the header: "Accept: text/plain; application/xhtml+xml; q=0.6,
text/html; q=0.8"

To perform content negotiation, the server just multiplies it's serving
preference by the user agent's preference to get the ranking for each
mime type.  We don't have a text/plain document at this URI so the
server's q value is 0.



application/xhtml+xml: q = 1 * 0.6 = 0.6

text/html: q = 0.7 * 0.8 = 0.56

text/plain: q = 0 * 1 = 0



So, the server should serve the xhtml document.

Re: Mobile Inflation

2005-09-17 07:41 • by foxyshadis
44278 in reply to 43999
Anonymous:
Anonymous:
That's
referring to something entirely different.  Just because both
refer to the word "quality" doesn't mean that the word is being used in
the same sense in both places :)


What
is it discussing then?  Looks to me like content alternatives in
HTTP requests for media type, encoding, and language.  Plus the
qvalue usage follows the same pattern.

Also, consider, why else
would the qvalue exist?  If the qvalue was *only* for
"preference", then why not simply list types in order of
preference?  (Which is what the default of no q= does.) 
Also, why is it called "quality" instead of something more like what
you describe, "preference"?  Seems rather ridiculous to call it
"quality" if it means "preference".



O'Reilly writes a less-technical description of HTTP headers. Let's see... Accept-Language: language qvalue.



Multiple languages can be listed separated by commas. The optional
qvalue represents, on a scale of 0 to 1, an acceptable quality level
for nonpreferred languages. Languages are written with their two-letter
abbreviations (e.g., en for English, de for German, fr for French,
etc.). See Appendix B for a listing of languages.




"Acceptable quality level for nonpreferred languages"



It's very easy (as you prove) to muddle the point. The quality is not
referring to preference, but QUALITY. However, since the number is
usually lowest for nonpreferred types, it is common to describe the
qvalue as a preference ranking. (Which is pretty much all anyone really
used it for anyway.)



   The example

Accept: audio/*; q=0.2, audio/basic

SHOULD be interpreted as "I prefer audio/basic, but send me any audio
type if it is the best available after an 80% mark-down in quality."



How is this supposed to be interpreted any other way than "send me
whatever you can convert it to with no more than 80% degradation"?



It's easiest to understand the point when you realise converting
anything (encoding, language, media type, etc) will always result in
some loss of quality. With the qvalue you were supposed to be able to
request conversion not take place if it degrades quality too
much.


Wait, wait, what's a lower quality language? I can ask for good german, mediocre japanese, or really muddled engrish? xD



I think you're really getting mixed up over the term quality. For one,
servers don't have any way of assigning quality values to files and
formats (it's technically possible, but it doesn't exist); servers
definitely won't convert multimedia into anything of any quality, and
even if they have various types and a mime mapping set up, they would
rely on your list of preferences, going down the list by quality order,
and finally just giving you something random (or a 404 if you have no
"audio/*"). Hell, servers with mime mappings failovers even set up are
few. Servers that actually do this sort of thing, like shoutcast and MS
streaming media, have entirely different methods of requesting
preferred formats and reduced quality.



I'd suggest taking some time to peruse IETF's mailing lists, where
every reference to qvalue refers only to a list of preferred types in
order.

« PrevPage 1 | Page 2Next »

Add Comment