HTTP 1.1 Accept-Encoding q parameter 


November 08, 2010 20:19:23    Last update: November 08, 2010 20:20:02
To tell the web server that it accepts GZIP encoding, a browser may send a header like this:
Accept-Encoding: gzip, deflate, compress;q=0.9

What does the parameter q mean? By RFC2616, the q parameter is an indicator of relative quality, with a range from 0 to 1. For example:
Accept: audio/*; q=0.2, audio/basic

means audio/basic is accepted with a q factor of 1 (since it's missing, the default value is 1), while audio/* is accepted with a q factor of 0.2. In other words, audio/basic is five times as preferable as audio/*.

Therefore, Accept-Encoding: gzip, deflate, compress;q=0.9 means that gzip and deflate are equally acceptable with a q factor of 1, but compress is accepted with a relatively lower "quality" factor of 0.9. Note that value for the Accept-Encoding header should be read in these three groups: gzip, deflate, and compress;q=0.9.

Also from RFC2616:
"Quality values" is a misnomer, since these values merely represent relative degradation in desired quality.
Share |
| Comment  | Tags