HTTP 14.3 http header-accept-encoding

Source: Internet
Author: User
http 14.3 http header-accept-encoding

In HTTP header

Accept-encoding is the type of encoding that the browser sends to the server declaring the browser supports.

Common to have

       Accept-encoding:compress, gzip//support compress and gzip type
       accept-encoding://default is Identity
       Accept-encoding: *//support for all types
       of accept-encoding:compress;q=0.5, gzip;q=1.0//In order to support gzip, compres S
       accept-encoding:gzip;q=1.0, identity; q=0.5, *;q=0       
The corresponding type-encoded header returned by the server is content-encoding
The rules for server processing accept-encoding are as follows
1. If the server can return any of the Encoding types defined in accept-encoding, then the processing succeeds (unless the value of Q equals 0, and 0 is unacceptable)
2. * represents any type of encoding (except that the defined type is displayed in accept-encoding)
3. If there are multiple encoding at the same time, according to the Q value order
4. Identity is always acceptable encoding type (unless the type of markup shown is q=0),   if the value of accept-encoding is null  then only identity is the type that will be accepted
If all types of servers in accept-encoding are not sent back, then you should return a 406 error to the client
If there is no accept-encoding in the request  
If there is identity in the accept-encoding, then the identity should be returned first (unless there is a definition of Q value, or you think another type is more meaningful)
Attention:
If the server does not support identity and the browser does not send accept-encoding, the server should prefer to use the "gzip" and "compress" in HTTP1.0, which  may be based on the client type Send a more appropriate type of encoding
Most HTTP1.0 clients cannot handle the Q value

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.