-
Notifications
You must be signed in to change notification settings - Fork 4
/
636.txt
160 lines (119 loc) · 8.23 KB
/
636.txt
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
* 仕様書
[REFS[
- [19] [CITE@en[RFC 1952 - GZIP file format specification version 4.3]] ([TIME[2014-11-02 13:39:48 +09:00]] 版) <https://tools.ietf.org/html/rfc1952>
]REFS]
* MIME 型
[REFS[
- [6] [CITE@en[RFC 6713 - The \x27application/zlib\x27 and \x27application/gzip\x27 Media Types]] ([TIME[2012-08-21 12:20:47 +09:00]] 版) <http://tools.ietf.org/html/rfc6713>
]REFS]
- [CODE(MIME)@en[[[application/zlib]]]]
- [CODE(MIME)@en[[[application/gzip]]]]
- [CODE(MIME)@en[[[application/gzip-compressed]]]]
- [CODE(MIME)@en[[[application/gzipped]]]]
- [CODE(MIME)@en[[[application/x-gunzip]]]]
- [CODE(MIME)@en[application/x-gzip]]
- [CODE(MIME)@en[[[application/x-gzip-compressed]]]]
- [CODE(MIME)@en[[[gzip/document]]]]
* 転送符号化 [CODE(HTTP)@en[gzip]]
[7] [[HTTP]] の[[転送符号化]] [DFN[[CODE(HTTP)@en[[[gzip]]]]]]
は、 [[gzip]] [[ファイル圧縮]]プログラムが生成する [[LZ77]]
[[符号化]]と32ビット [[CRC]] による[[符号化]] [SRC[[[RFC 1952]]]]
を表します [SRC[>>8, >>11, >>12]]。
** 仕様書
[REFS[
- [8] '''[CITE@en[RFC 7230 - Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing]] ([TIME[2014-06-07 01:59:35 +09:00]] 版) <https://tools.ietf.org/html/rfc7230#section-4.2.3>'''
- [11] [CITE@en[RFC 7230 - Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing]] ([TIME[2014-06-07 01:59:35 +09:00]] 版) <https://tools.ietf.org/html/rfc7230#section-8.5>
- [12] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-06-07 01:55:45 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#page-12>
- [17] [CITE@en[RFC 6968 - FCAST: Object Delivery for the Asynchronous Layered Coding (ALC) and NACK-Oriented Reliable Multicast (NORM) Protocols]] ([TIME[2014-09-14 18:07:31 +09:00]] 版) <https://tools.ietf.org/html/rfc6968#page-21>
]REFS]
** 名前
[9] [[転送符号化]]の名前は [CODE(HTTP)@en[[[gzip]]]] です [SRC[>>8, >>11]]。
[10] [[受信者]]は [DFN[[CODE(HTTP)@en[[[x-gzip]]]]]] も等価として扱う[['''べきです''']]
[SRC[>>8, >>11]]。
** 処理
[18] [[FCAST]] の実装は、 [CODE(HTTP)@en[[[Content-Encoding:]] [[gzip]]]]
に対応しなければ[['''なりません''']] [SRC[>>17]]。
* 実現値操作 [CODE(HTTP)@en[gzip]]
[14] [[実現値操作]] [DFN[[CODE(HTTP)@en[[[gzip]]]]]] は、
[[内容符号化]] [CODE(HTTP)@en[[[gzip]]]] と同じです [SRC[>>13]]。
[16] [CODE(HTTP)@en[[[gdiff]]]] や [CODE(HTTP)@en[[[diffe]]]] は[[圧縮]]によって大きくサイズを削減できますから、
[CODE(HTTP)@en[[[gzip]]]] も実装することが[RUBYB[強く推奨]@en[strongly recommended]]されています [SRC[>>15]]。
** 仕様書
[REFS[
- [13] [CITE@en[RFC 3229 - Delta encoding in HTTP]] ([TIME[2014-10-26 21:15:25 +09:00]] 版) <http://tools.ietf.org/html/rfc3229#section-10.1>
- [15] [CITE@en[RFC 3229 - Delta encoding in HTTP]] ([TIME[2014-10-26 21:15:25 +09:00]] 版) <http://tools.ietf.org/html/rfc3229#section-10.9>
]REFS]
** 歴史
[89] [[IANA登録簿]]には [[RFC 2616]] を出典として登録されています [SRC[>>88]]。
[[RFC 723x]] 出版後も出典は更新されていません。 [TIME[2014-11-19T16:22:24.500Z]]
[REFS[
- [88] [CITE[Instance Manipulation Values]] ([TIME[2014-01-31 02:45:13 +09:00]] 版) <http://www.iana.org/assignments/inst-man-values/inst-man-values.xhtml>
]REFS]
* 実装
[2] [[Perlでのgzipの圧縮・展開]]
[1] [[WinIE]] の gzip 展開処理ってすごく遅くないですか?
[28] [CODE(HTTP)@en[Content-Type:]] が [CODE(MIME)@en[application/x-gzip]]
で、 [CODE(HTTP)@en[Content-Encoding:]] が無しのもの:
[FIG(list)[
- [24] [CITE[Index of /archives]] ([TIME[2016-05-05 23:39:14 +09:00]]) <http://www.ring.gr.jp/archives/>、[CODE[.gz]] や [CODE[.tgz]]
- [26] [[GitHub]] の [CODE[.tar.gz]] ファイルのダウンロード
[TIME[2016-05-05T14:42:39.00Z]]
- [27] [[SourceForge]] の [CODE[.gz]] [TIME[2016-05-05T14:58:43.100Z]]
- [29] [[ViewVC]] の [CODE[.tar.gz]] を生成してダウンロード [TIME[2016-05-05T14:58:44.400Z]]
- [30] [[search.cpan.org]] [TIME[2016-05-05T15:01:09.700Z]]
- [33] [CITE[cURL: tar.gz from Mirrors]] ([TIME[2016-05-06 00:08:38 +09:00]]) <https://curl.haxx.se/latest.cgi?curl=tar.gz> の[[ミラーサイト]]4つのうち3つ
- [35] [CITE@en[OpenSSL]] ([[OpenSSL Foundation, Inc.]]著, [TIME[2016-05-06 00:09:56 +09:00]]) <https://www.openssl.org/source/>
- [36] [CITE@en[DBMail: Download]] ([TIME[2016-05-06 00:12:55 +09:00]]) <http://www.dbmail.org/index.php?page=download>
- [43] [CITE[Index of /pub/linux/kernel/v3.x]] ([TIME[2016-05-06 00:26:44 +09:00]]) <https://www.kernel.org/pub/linux/kernel/v3.x/>
- [44] [CITE[EPIwm Download]] ([TIME[2016-05-06 00:30:00 +09:00]]) <http://www.nongnu.org/epiwm/download.html>
[[IIS]]
- [46] [CITE@en[CRAN Packages By Name]] ([TIME[2016-05-05 23:05:08 +09:00]]) <https://cran.r-project.org/web/packages/available_packages_by_name.html>
]FIG]
[32] [CODE(HTTP)@en[Content-Type:]] が [CODE(MIME)@en[application/octet-stream]]
で [CODE(HTTP)@en[Content-Encoding:]] は無しのもの:
[FIG(list)[
- [25] [[SourceForge]] の [CODE[.tgz]]
[TIME[2016-05-05T14:53:08.800Z]]
- [31] [CITE[Index of /download/]] ([TIME[2016-05-06 00:04:45 +09:00]]) <http://nginx.org/download/>
- [34] [CITE[cURL: tar.gz from Mirrors]] ([TIME[2016-05-06 00:08:38 +09:00]]) <https://curl.haxx.se/latest.cgi?curl=tar.gz> の[[ミラーサイト]]4つのうち1つ
- [45] [CITE@en[PyPI - the Python Package Index : Python Package Index]] ([TIME[2016-05-06 00:31:58 +09:00]]) <https://pypi.python.org/pypi>
- [49] [CITE[The Tengine Web Server]] ([TIME[2016-05-04 22:49:39 +09:00]]) <http://tengine.taobao.org/download.html>
]FIG]
[41] [CODE(HTTP)@en[Content-Type:]] が [CODE(MIME)@en[application/binary]]
で [CODE(HTTP)@en[Content-Encoding:]] は無しのもの:
[FIG(list)[
- [40] [CITE[Index of /libsodium/releases/]] ([TIME[2016-05-06 00:20:42 +09:00]]) <https://download.libsodium.org/libsodium/releases/>
]FIG]
[48] [CODE(HTTP)@en[Content-Type:]] が [CODE(MIME)@en[binary/octet-stream]]
で [CODE(HTTP)@en[Content-Encoding:]] は無しのもの:
[FIG(list)[
- [47] [CITE@en[Downloads - Snort.Org]] ([TIME[2016-05-06 00:38:07 +09:00]]) <https://www.snort.org/downloads>
]FIG]
[37] [CODE(HTTP)@en[Content-Type:]] が展開後のファイル形式で、
[CODE(HTTP)@en[Content-Encoding:]] が [CODE[gzip]] のもの:
[FIG(list)[
- [38] [CITE@en[Index of /rrdtool/pub]] ([TIME[2016-05-06 00:15:48 +09:00]]) <http://oss.oetiker.ch/rrdtool/pub/>
]FIG]
;; [39] [[ダウンロード]]すると、 [[Chrome]] は展開したものを保存し、
[[Firefox]] は圧縮されたものを保存するようです。
[TIME[2016-05-05T15:18:52.000Z]]
[22] [CITE[Directory Listing: /]] ([TIME[2016-05-05 23:31:43 +09:00]]) <http://ftp.mozilla.org/>
[23] >>22 [[gzip]] ファイルに [CODE(HTTP)@en[Content-Encoding:]] はありませんが、
[CODE(HTTP)@en[Content-Type:]] は展開後のファイル形式を表している、
という変な状態になっています。 [TIME[2016-05-05T14:33:27.300Z]]
* メモ
[3][CITE@en[gzip - Wikipedia, the free encyclopedia]] ([TIME[2008-11-12 13:59:37 +09:00]] 版) <http://en.wikipedia.org/wiki/Gzip>
[4]
>>3
>Many server implementations, however, incorrectly implement the protocol by using the raw [[DEFLATE]] stream format ([[RFC 1951]]) instead. The bug is sufficiently pervasive that most modern browsers will accept both [[RFC 1951]] and [[RFC 1950]]-formatted data for the “[[deflate]]” compressed method.
[5] [CITE[gzip - Wikipedia, the free encyclopedia]] (Referenced: [TIME[2009-07-17T21:25:15+09:00]])
<http://en.wikipedia.org/wiki/Gzip>
[20] [CITE@en[RFC 6713 - The 'application/zlib' and 'application/gzip' Media Types]]
([TIME[2015-09-27 13:20:11 +09:00]] 版)
<https://tools.ietf.org/html/rfc6713>
[21] [CITE@ja[gzip - Wikipedia]]
([TIME[2016-01-31 22:25:05 +09:00]] 版)
<https://ja.wikipedia.org/wiki/Gzip>
[42] [CITE@en[233047 – From some download servers, browser uncompresses gzip file, but keeps gz extension. Download manager is confused over file size and time remaining (nsBinaryDetector)]]
( ([TIME[2016-05-06 00:23:32 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=233047>