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