-
Notifications
You must be signed in to change notification settings - Fork 4
/
74.txt
88 lines (67 loc) · 4.83 KB
/
74.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
[2] 意味的に意味のある形で ([[HTTP]] の通常の処理で要求されるもの以上の)
メッセージを変更するよう設計された、あるいは設定された [[HTTP]] から [[HTTP]]
への[[串]]を、[DFN[[RUBYB[[[変形串]]]@en[transforming proxy]]]]といいます [SRC[>>1]]。
* 仕様書
[REFS[
- [1] '''[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-5.7.2>'''
- [9] [CITE@en[RFC 7234 - Hypertext Transfer Protocol (HTTP/1.1): Caching]] ([TIME[2014-09-11 10:19:59 +09:00]] 版) <https://tools.ietf.org/html/rfc7234#section-5.2>
-- [7] [CITE@en[RFC 7234 - Hypertext Transfer Protocol (HTTP/1.1): Caching]] ([TIME[2014-09-11 10:19:59 +09:00]] 版) <https://tools.ietf.org/html/rfc7234#section-5.2.1.6>
-- [11] [CITE@en[RFC 7234 - Hypertext Transfer Protocol (HTTP/1.1): Caching]] ([TIME[2014-09-11 10:19:59 +09:00]] 版) <https://tools.ietf.org/html/rfc7234#section-5.2.2.4>
- [13] [CITE@en[RFC 7234 - Hypertext Transfer Protocol (HTTP/1.1): Caching]] ([TIME[2014-09-11 10:19:59 +09:00]] 版) <https://tools.ietf.org/html/rfc7234#section-5.5.6>
]REFS]
* [CODE(HTTP)@en[Cache-Control: no-transform]]
[8] [[要求]]や[[応答]]の [CODE(HTTP)@en[[[Cache-Control:]]]] [[ヘッダー]]の
[DFN[[CODE(HTTP)@en[[[no-transform]]]]]] [[キャッシュ指令]]は、
[[中間器]]が ([[キャッシュ]]であるかどうかに関わらず)
[[payload]] を[[変形]]しては[['''ならない''']]ことを示します [SRC[>>7, >>11]]。
[10] この[[キャッシュ指令]]は[[引数]]を指定できません [SRC[>>9]]。
* 処理モデル
[3] [[串]]は、 [CODE(HTTP)@en[[[no-transform]]]] [[キャッシュ制御指令]]を含む[[メッセージ]]の
[[payload]] を[[変形]]しては[['''なりません''']] [SRC[>>1]]。
[4] [[串]]は、 >>3 以外の[[メッセージ]]の [[payload]] を[[変形]]して[['''構いません''']]
[SRC[>>1]]。
[215] [[payload]] を[[変形]]する[[串]]は、[[警告符号]] [CODE(HTTP)[[[214]]]]
の [CODE(HTTP)@en[[[Warning:]]]] [[ヘッダー]]を (なければ) 追加しなければ[['''なりません''']]
[SRC[>>1, >>13]]。
[216] [[payload]] を[[変形]]する[[串]]は、 [CODE(HTTP)[[[200]]]] [[応答]]を[[転送]]する時に
[CODE(HTTP)[[[203]]]] に[[状態符号]]を変更することができます [SRC[>>1]]。
[14] [[変形]]と[[条件付き要求]]や[[範囲要求]]との関係は定かではありません。
[[範囲]]に対して[[変形]]を適用できるかは怪しいところですから、
[[範囲要求]]は[[変形]]後に適用されると解するべきでしょうか。
[15] [[実体タグ]]と[[変形]]の関係性も怪しいところです。
[[変形]]した場合は[[実体タグ]]は除去するべきかもしれません。
[16] [[キャッシュ]]に関する [[HTTP]] 的な操作を正しく行うことを考えると、
[[キャッシュ項目]]として保存するのは[[変形]]前の状態か、
あるいは両方を保存して[[上流]]に対する操作には前の状態を使うようにしないといけません。
* 歴史
[FIG(quote)[
[FIGCAPTION[
[12] [[RFC 2068]]/[[RFC 2616]] 14.9.5 No-Transform Directive [INS[非変換指令]]
]FIGCAPTION]
>
:[INS[no-transform]]:
Implementers of intermediate caches (proxies) have found it useful to
convert the media type of certain entity bodies. A [INS[non-transparent]]
proxy might, for example, convert between image formats in order to save cache space
or to reduce the amount of traffic on a slow link. [DEL[HTTP has to date been silent on these transformations.]]
> Serious operational problems [DEL[have already occurred]] [INS[occur]], however, when
these transformations [DEL[have been]] [INS[are]] applied to entity bodies intended for
certain kinds of applications. For example, applications for medical
imaging, scientific data analysis and those using end-to-end
authentication, all depend on receiving an entity body that is bit
for bit identical to the original entity-body.
> Therefore, if a response includes the no-transform directive, an
intermediate cache or proxy MUST NOT change those headers that are
listed in section 13.5.2 as being subject to the no-transform
directive. This implies that the cache or proxy [DEL[must not]] [INS[MUST NOT]]
change any aspect of the entity-body that is specified by these headers[DEL[.]][INS[,]] including the value of the entity-body itself.
]FIG]
* 実装
[REFS[
- [5] [CITE[Hatena::MobileGateway]]
([TIME[2011-09-09 12:16:11 +09:00]] 版)
<http://mgw.hatena.ne.jp/help#deny>
]REFS]
[6] >>5 は [[HTTP]] でいう[[中間器]]ではありませんが、
[[応答]]の [CODE(HTTP)@en[[[Cache-Control:]] [[no-transform]]]]
に対応しているようです。