aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/http/headers/content-encoding/index.html
blob: f9c649465993fdceb6fbf2ca7045ba2aecef0e37 (plain)
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
---
title: Content-Encoding
slug: Web/HTTP/Headers/Content-Encoding
translation_of: Web/HTTP/Headers/Content-Encoding
---
<div>{{HTTPSidebar}}</div>

<p><strong><code>Content-Encoding</code></strong> 개체 헤더는 미디어 타입을 압축하기 위해 사용됩니다. 이 헤더가 존재하면, 그 값은 개체 본문에 어떤 추가적인 컨텐츠 인코딩이 적용될지를 나타냅니다. 그것은 <code>Content-Type</code> 헤더에 의해 참조되는 미디어 타입을 얻도록 디코드하는 방법을 클라이언트가 알게 해줍니다.</p>

<p>가능한 더 많은 데이터를 압축하기 위해 이 필드의 사용이 권고되지만, jpeg 이미지와 같은 어떤 유형의 리소스들은 이미 압축되어 때때로 추가적인 압축이 별 소용이 없고 페이로드를 더 길게 만들수도 있습니다.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Header type</th>
   <td>{{Glossary("Entity header")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name")}}</th>
   <td>no</td>
  </tr>
 </tbody>
</table>

<h2 id="문법">문법</h2>

<pre class="syntaxbox">Content-Encoding: gzip
Content-Encoding: compress
Content-Encoding: deflate
Content-Encoding: identity
Content-Encoding: br
</pre>

<h2 id="디렉티브">디렉티브</h2>

<dl>
 <dt><code>gzip</code></dt>
 <dd>32비트 CRC를 지닌, <a class="external" href="http://en.wikipedia.org/wiki/LZ77_and_LZ78#LZ77">Lempel-Ziv coding</a> (LZ77)을 사용하는 포맷. 이는 본래 UNIX <em>gzip</em> 프로그램의 포맷입니다. HTTP/1.1 표준 역시 이 컨텐츠 인코딩을 지원하는 서버는 호환성 목적으로, <code>x-gzip</code> 별칭의 인지가 권고됩니다.</dd>
 <dt><code>compress</code></dt>
 <dd><a class="external" href="http://en.wikipedia.org/wiki/LZW">Lempel-Ziv-Welch</a> (LZW) 알고리즘을 사용하는 포맷. 그 값의 이름은 이 알고리즘을 구현한 UNIX <em>compress</em> 프로그램으로부터 가져왔습니다.<br>
 대부분의 UNIX 배포판으로부터 사라져 왔던 압축 프로그램처럼, 이 content-encoding은 (2013년에 만료된)특허권 이슈로 오늘날의 브라우저에서 사용되지 않습니다.</dd>
 <dt><code>deflate</code></dt>
 <dd>(<a class="external" href="http://tools.ietf.org/html/rfc1952">RFC 1951</a>에 정의된) <a class="external" href="http://en.wikipedia.org/wiki/DEFLATE"><em>deflate</em></a> 압축 알고리즘을 이용한, (<a class="external" href="http://tools.ietf.org/html/rfc1950">RFC 1950</a>에 정의된) <a class="external" href="http://en.wikipedia.org/wiki/Zlib">zlib</a> 스트럭쳐를 사용합니다.</dd>
 <dt><code>identity</code></dt>
 <dd>identity 함수를 나타냅니다(즉, 압축 없음 혹은 변경 없음). 이 토큰은, 명시적으로 지정된 경우를 제외하고, 항상 수용 가능하다고 여겨집니다.</dd>
 <dt><code>br</code></dt>
 <dd><a href="https://en.wikipedia.org/wiki/Brotli">Brotli</a> 알고리즘을 사용하는 포맷.</dd>
</dl>

<h2 id="예제">예제</h2>

<h3 id="gzip을_이용해_압축하기">gzip을 이용해 압축하기</h3>

<p>클라이언트 측에서, HTTP 요청 내에 함께 전송될 압축 스킴 목록을 알릴 수 있습니다. {{HTTPHeader("Accept-Encoding")}} 헤더는 컨텐츠 인코딩 협상을 위해 사용됩니다.</p>

<pre>Accept-Encoding: gzip, deflate</pre>

<p>서버는 사용한 스킴을 <code>Content-Encoding</code> 응답 헤더에 표시하여 응답합니다.</p>

<pre>Content-Encoding: gzip</pre>

<p>서버는 어떤 압축 방법도 사용하도록 강요받지 않는다는 것을 알아두시기 바랍니다. 압축은 서버 설정과 사용되는 서버 모듈에 상당히 의존적입니다.</p>

<h2 id="명세">명세</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">명세</th>
   <th scope="col">제목</th>
  </tr>
  <tr>
   <td>{{RFC("7231", "Content-Encoding", "3.1.2.2")}}</td>
   <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
  </tr>
  <tr>
   <td><a href="http://www.ietf.org/id/draft-alakuijala-brotli">http://www.ietf.org/id/draft-alakuijala-brotli</a></td>
   <td>Brotli Compressed Data Format</td>
  </tr>
 </tbody>
</table>

<h2 id="브라우저_호환성">브라우저 호환성</h2>

<p>{{Compat}}</p>

<h2 id="함께_참고할_내용">함께 참고할 내용</h2>

<ul>
 <li>{{HTTPHeader("Accept-Encoding")}}</li>
 <li>{{HTTPHeader("Transfer-Encoding")}}</li>
</ul>