1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
---
title: Accept-Encoding
slug: Web/HTTP/Headers/Accept-Encoding
translation_of: Web/HTTP/Headers/Accept-Encoding
---
<div>{{HTTPSidebar}}</div>
<p><strong><code>Accept-Encoding</code></strong> 요청 HTTP 헤더는, 보통 압축 알고리즘인, 클라이언트가 이해 가능한 컨텐츠 인코딩이 무엇인지를 알려줍니다. <a href="/en-US/docs/Web/HTTP/Content_negotiation">컨텐츠 협상</a>을 사용하여, 서버는 제안된 내용 중 하나를 선택하고 사용하며 {{HTTPHeader("Content-Encoding")}} 응답 헤더를 이용해 선택된 것을 클라이언트에게 알려줍니다.</p>
<p>클라이언트와 서버 모두 동일한 압축 알고리즘을 지원한다고 해도, 식별 값 또한 수용 가능하다면, 서버는 응답의 본문을 압축하지 않으려고 할 수 있습니다. 두 가지 일반적인 경우가 이런 일을 초래합니다:</p>
<ul>
<li>전송되어야 할 데이터가 이미 압축되어 있고 두번째 압축이 전송해야 할 데이터를 더 작게 만들지 못할 경우가 있습니다. 이런 경우는 이미지 포맷 압축에 해당되는 경우가 많습니다;</li>
<li>서버에 과부하가 걸리고 압축 요구사항에 의해 초래된 연산의 오버헤드를 감당할 수 없는 경우가 있습니다. 일반적으로, Microsoft는 서버가 자신의 연산력의 80% 이상을 사용하는 경우 압축하지 않을 것을 권고하고 있습니다.</li>
</ul>
<p>부호화(encoding)되지 않았음을 의미하는, <code>identity</code> 값이 식별에 대한 다른 명시적인 설정 값 없이 <code>identity;q=0</code> or a <code>*;q=0</code>에 의해 명시적으로 숨겨지지 않는 한, 서버는 {{HTTPStatus("406")}} <code>Acceptable</code> 오류를 회신해서는 결코 안됩니다.</p>
<div class="note"><strong>Notes:</strong>
<ul>
<li>
<p>IANA 레지스트리는 <a class="external" href="http://www.iana.org/assignments/http-parameters/http-parameters.xml#http-parameters-1">공식적인 컨텐츠 인코딩의 전체 목록</a>을 운영 중입니다.</p>
</li>
<li>두 개의 다른 컨텐츠 인코딩, <code>bzip</code>과 <code>bzip2</code>이 표준은 아니지만 때때로 사용되기도 합니다. 그들은 두 개의 UNIX 프로그램에 의해 사용되는 알고리즘을 구현합니다. 첫번째 알고리즘은 특허 라이선스 문제 때문에 더 이상 유지되지 않는다는 것을 알아두시기 바랍니다.</li>
</ul>
</div>
<table class="properties">
<tbody>
<tr>
<th scope="row">헤더 타입</th>
<td>{{Glossary("Request header")}}</td>
</tr>
<tr>
<th scope="row">{{Glossary("Forbidden header name")}}</th>
<td>yes</td>
</tr>
</tbody>
</table>
<h2 id="문법">문법</h2>
<pre class="syntaxbox">Accept-Encoding: gzip
Accept-Encoding: compress
Accept-Encoding: deflate
Accept-Encoding: br
Accept-Encoding: identity
Accept-Encoding: *
// Multiple algorithms, weighted with the {{Glossary("Quality Values", "quality value")}} syntax:
Accept-Encoding: deflate, gzip;q=1.0, *;q=0.5</pre>
<h2 id="디렉티브">디렉티브</h2>
<dl>
<dt><code>gzip</code></dt>
<dd>32비트 CRC와 함께 <a class="external external-icon" href="http://en.wikipedia.org/wiki/LZ77_and_LZ78#LZ77">Lempel-Ziv coding</a> (LZ77)를 사용하는 압축 포맷.</dd>
<dt><code>compress</code></dt>
<dd><a class="external external-icon" href="http://en.wikipedia.org/wiki/LZW">Lempel-Ziv-Welch</a> (LZW) 알고리즘을 사용하는 압축 포맷.</dd>
<dt><code>deflate</code></dt>
<dd><em><a class="external external-icon" href="http://en.wikipedia.org/wiki/DEFLATE">deflate</a> </em>압축 알고리즘과 함께 <a class="external external-icon" href="http://en.wikipedia.org/wiki/Zlib">zlib</a> 구조를 사용하는 압축 포맷.</dd>
<dt><code>br</code></dt>
<dd><a class="external external-icon" href="https://en.wikipedia.org/wiki/Brotli">Brotli</a> 알고리즘을 사용하는 압축 포맷.</dd>
<dt><code>identity</code></dt>
<dd>식별 함수(압축하지 않거나 수정하지 않은 경우)를 가리킵니다. 이 값은 존재하지 않은 경우에도 항상 수용 가능하다고 여겨집니다.</dd>
<dt><code>*</code></dt>
<dd>헤더 내에 아직 나열되지 않은 컨텐츠 인코딩이라도 일치됩니다. 헤더가 존재하지 않을 경우, 기본값이 됩니다. 그것이 모든 알고리즘이 지원된다는 것을 의미하지는 않습니다; 단지 표현된 선호 대상이 없다는 것을 의미합니다.</dd>
<dt><code>;q=</code> (q값 가중치)</dt>
<dd><em>weight</em>라고 부르는 상대적인 <a href="/en-US/docs/Glossary/Quality_value">퀄리티 값</a>을 사용하여 표현한 선호도에 따라 배치된 값입니다.</dd>
</dl>
<h2 id="예제">예제</h2>
<pre>Accept-Encoding: gzip
Accept-Encoding: gzip, compress, br
Accept-Encoding: br;q=1.0, gzip;q=0.8, *;q=0.1
</pre>
<h2 id="명세">명세</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">명세</th>
<th scope="col">제목</th>
</tr>
<tr>
<td>{{RFC("7231", "Accept-Encoding", "5.3.4")}}</td>
<td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Context</td>
</tr>
</tbody>
</table>
<h2 id="브라우저_호환성">브라우저 호환성</h2>
<p>{{Compat("http.headers.Accept-Encoding")}}</p>
<h2 id="함께_참고할_내용">함께 참고할 내용</h2>
<ul>
<li>HTTP <a href="/en-US/docs/Web/HTTP/Content_negotiation">컨텐츠 협상</a></li>
<li>컨텐츠 협상의 결과를 이용한 헤더: {{HTTPHeader("Content-Encoding")}}</li>
<li>다른 유사한 헤더들: {{HTTPHeader("TE")}}, {{HTTPHeader("Accept")}}, {{HTTPHeader("Accept-Charset")}}, {{HTTPHeader("Accept-Language")}}</li>
</ul>
|