Compare Revisions

Accept-Encoding

Change Revisions

Revision 1106805:

Revision 1106805 by teoli on

Revision 1106807:

Revision 1106807 by teoli on

Title:
Accept-Encoding
Accept-Encoding
Slug:
Web/HTTP/Headers/Accept-Encoding
Web/HTTP/Headers/Accept-Encoding
Tags:
"Content Negotiation" "HTTP" "HTTP Header" "Reference" "Request header"
"Content Negotiation" "HTTP" "HTTP Header" "Reference" "Request header"
Content:

Revision 1106805
Revision 1106807
n37Accept-Encoding: <content_encoding>n37Accept-Encoding: gzip
38Accept-Encoding: <content_encoding>, <content_encoding&g38Accept-Encoding: compress
>t; 
39Accept-Encoding: deflate
40Accept-Encoding: br
41Accept-Encoding: identity
42Accept-Encoding: *
43 
44// Multiple algorithms, weighted with the q-factor syntax:
45Accept-Encoding: deflate, gzip;q=1.0, *;q=0.5
n45        &lt;content_encoding&gt;n52        <code>gzip</code>
t48        A list of content encoding algorithms, usually compressiot
>n algorithms. Their order of preference is expressed using relati 
>ve <a href="/en-US/docs/Glossary/Q-factor">quality factor</a> cal 
>led the <em>weight</em>. The possible algorithms are: 
49        <table class="standard-table">
50          <thead>
51            <tr>
52              <th scope="col">
53                Algorithm
54              </th>
55              <th scope="col">
56                Description
57              </th>
58            </tr>
59          </thead>
60          <tbody>
61            <tr>
62              <td>
63                <code>gzip</code>
64              </td>
65              <td>
66                A compression format using the <a class="external55        A compression format using the <a class="external externa
> external-icon" href="http://en.wikipedia.org/wiki/LZ77_and_LZ78#>l-icon" href="http://en.wikipedia.org/wiki/LZ77_and_LZ78#LZ77">Le
>LZ77">Lempel-Ziv coding</a> (LZ77), with a 32-bit CRC.>mpel-Ziv coding</a> (LZ77), with a 32-bit CRC.
67              </td>56      </dd>
68            </tr>57      <dt>
69            <tr>
70              <td>
71                <code>compress</code>58        <code>compress</code>
72              </td>59      </dt>
73              <td>60      <dd>
74                A compression format using the <a class="external61        A compression format using the <a class="external externa
> external-icon" href="http://en.wikipedia.org/wiki/LZW">Lempel-Zi>l-icon" href="http://en.wikipedia.org/wiki/LZW">Lempel-Ziv-Welch<
>v-Welch</a> (LZW) algorithm.>/a> (LZW) algorithm.
75              </td>62      </dd>
76            </tr>63      <dt>
77            <tr>
78              <td>
79                <code>deflate</code>64        <code>deflate</code>
80              </td>65      </dt>
81              <td>66      <dd>
82                A compression format using the <a class="external67        A compression format using the <a class="external externa
> external-icon" href="http://en.wikipedia.org/wiki/Zlib">zlib</a>>l-icon" href="http://en.wikipedia.org/wiki/Zlib">zlib</a> structu
> structure, with the <a class="external external-icon" href="http>re, with the <a class="external external-icon" href="http://en.wi
>://en.wikipedia.org/wiki/DEFLATE"><em>deflate</em></a> compressio>kipedia.org/wiki/DEFLATE"><em>deflate</em></a> compression algori
>n algorithm.>thm.
83              </td>68      </dd>
84            </tr>69      <dt>
85            <tr>
86              <td>
87                <code>br</code>70        <code>br</code>
88              </td>71      </dt>
89              <td>72      <dd>
90                A compression format using the <a class="external73        A compression format using the <a class="external externa
> external-icon" href="https://en.wikipedia.org/wiki/Brotli">Brotl>l-icon" href="https://en.wikipedia.org/wiki/Brotli">Brotli</a> al
>i</a> algorithm.>gorithm.
91              </td>74      </dd>
92            </tr>75      <dt>
93            <tr>
94              <td>
95                <code>identity</code>76        <code>identity</code>
96              </td>77      </dt>
97              <td>78      <dd>
98                Indicates the identity function (i.e. no compress79        Indicates the identity function (i.e. no compression, nor
>ion, nor modification).&nbsp; This is the default value if the he> modification. This value is always considered as acceptable, eve
>ader is not present.>n if not present.
99              </td>80      </dd>
100            </tr>81      <dt>
101            <tr>
102              <td>
103                <code>*</code>82        <code>*</code>
104              </td>83      </dt>
105              <td>84      <dd>
106                Matches any content encoding not already listed i85        Matches any content encoding not already listed in the he
>n the header>ader. This is the default value if the header is not present. It 
 >doesn't mean that any algorithm is supported; merely that no pref
 >erence is expressed.
107              </td>86      </dd>
108            </tr>87      <dt>
109          </tbody>88        <code>;q=</code> (q-factor weighting)
110        </table>89      </dt>
90      <dd>
91        Any value used is placed in an order of preference expres
 >sed using relative <a href="/en-US/docs/Glossary/Q-factor">qualit
 >y factor</a> called the <em>weight</em>.

Back to History