/
409.txt
203 lines (153 loc) · 10.3 KB
/
409.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
[1] [DFN[[CODE(HTTP)@en[[[Pragma:]]]]]] [[ヘッダー]]は、
[[キャッシュ]]に関する指示を記述するものでした。 [CODE(HTTP)@en[[[Cache-Control:]]]]
[[ヘッダー]]の導入以前に使われていました。
* 仕様書
[REFS[
- [14] [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.4>
]REFS]
* 意味
[16] [CODE(HTTP)@en[[[Pragma:]]]] [[ヘッダー]]は、 [[HTTP/1.0]]
時代に[[受信者]]に対する[[実装規定]]の[[指令]]を記述するためのものとして導入されました。
[[HTTP/1.1]] 時代になって[[相互運用性]]を損ねるものとして[[非推奨]]とされています。 [SRC[>>14]]
[17] 現在は [CODE(HTTP)@en[[[Pragma:]]]] [[ヘッダー]]は
[[HTTP/1.0]] [[キャッシュ]]との[[後方互換性]]のために
[CODE(HTTP)@en[[[no-cache]]]] [[指令]]を記述するためのものとされています [SRC[>>14]]。
* 構文
[21] [CODE(HTTP)@en[[[Pragma:]]]] [[ヘッダー]]の値は、1つ以上の
[CODE(ABNF)@en[pragma-directive]] の[[リスト]] ([CODE(HTTP)[#]]) です [SRC[>>14]]。
[FIG(railroad)[
= [CODE(ABNF)@en[pragma-directive]]
= *
== [[OWS]]
== [CODE(HTTP)[[[,]]]]
== [[OWS]]
== [CODE(ABNF)@en[pragma-directive]]
]FIG]
[22] [CODE(ABNF)@en[pragma-directive]] は、名前と値を [CODE(HTTP)[[[=]]]]
で連結したものです。ただし [CODE(HTTP)[=]] と値は省略できます。 [SRC[>>14]]
[23] 名前は[[字句]]です [SRC[>>14]]。[[大文字・小文字不区別]]です。
;; [28] 仕様上は [[ABNF]] により [CODE(HTTP)@en[[[no-cache]]]] が[[大文字・小文字不区別]]と明確になっていますが、それ以外がそうなのかどうかは明言されていません。
[24] 値は[[字句]]または[[引用文字列]]です。 [SRC[>>14]]
[FIG(railroad)[
= [[字句]]
= ?
== [CODE(HTTP)[[[=]]]]
== |
=== [[字句]]
=== [[引用文字列]]
]FIG]
[26] 値の有無やその解釈は [CODE(ABNF)@en[pragma-directive]] によって異なります。
;; [25] [CODE(HTTP)[[[=]]]] の前後に [[BWS]] は無いようです。
* 文脈
[18] [[クライアント]]は、 [[HTTP/1.0]] [[キャッシュ]]との[[後方互換性]]のために必要なら
[CODE(HTTP)@en[[[Pragma:]] [[no-cache]]]] を指定できます [SRC[>>14]]。
[13] 明記されていませんが、 [CODE(HTTP)[[[304]]]] でも使って良いと推測されます。
* 処理モデル
[19] [[要求]]に [CODE(HTTP)@en[[[Cache-Control:]]]] [[ヘッダー]]が含まれる場合、
[CODE(HTTP)@en[[[Pragma:]]]] [[ヘッダー]]は無視されます [SRC[>>14]]。
;; [20] [CODE(HTTP)@en[[[Cache-Control:]] [[no-cache]]]] が含まれなくても、
[CODE(HTTP)@en[[[Cache-Control:]]]] [[ヘッダー]]があれば無視されるようです。
* [CODE(ABNF)@en[pragma-directive]]
[7] [CODE(ABNF)@en[[[pragma-directive]]]] としては次のものがあります。
[FIG(short list)[
- [CODE(HTTP)@en[[[no-cache]]]]
- [CODE(HTTP)@en[[[for]]]]
]FIG]
[2] この他 >>305 で多くの値が規定されています。
;; [27] [CODE(HTTP)@en[[[no-cache]]]] 以外は[[非推奨]]とされているようですが (>>16)、
他の値も特に禁止はされていません。
* 歴史
- [4] ''CMU School of Computer Science'' <http://www-2.cs.cmu.edu/webhelp/for-protocol.html> (1996年) は [CODE(HTTP)[[[for]]]] 引数を提案しています。要求では [CODE(HTTP)[Pragma: for=anyone]] または [CODE(HTTP)[Pragma: for=fqdn.example]], 応答ではこれに加えて [CODE(HTTP)[Pragma: for=request]] が使えます。複数可。実体の対象利用者を表すものみたいです。[WEAK[実用になるのか怪しいですし、結局標準化されずじまい。歴史的なものですね。]] 提案者のところのサーバーで実装していたみたいですが、今そのサーバーは普通の [[Apache]] みたいです。
[REFS[
- [11] [CITE[Request Headers in the HTTP protocol]]
( ([TIME[2001-11-29 11:01:38 +09:00]] 版))
<http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#pragma>
]REFS]
[5] >>11 は [CODE(HTTP)[no-cache]] を RFC 1945 と同じ意味で定義しています。それだけ。
[6] >>11 は、構文を自然言語で [CODE(ABNF)[[DFN[Pragma]] := #(token *(";" parameter))]] と定義していました。
[FIG(quote)[
[FIGCAPTION[
[15] RFC 1945 (HTTP/1.0) 10.12; RFC 2068・2616 (HTTP/1.1) 14.32 Pragma
]FIGCAPTION]
> The Pragma general-header field is used to include implementation-specific directives that [DEL[may]] [INS[[INS[{2616}]] might]] apply to any recipient along the
request/response chain. All pragma directives specify optional
behavior from the viewpoint of the protocol; however, some systems [DEL[may]] [INS[MAY]] require that behavior be consistent with the directives.
[CODE(HTTP)[Pragma]] [[一般頭欄]]は、要求・応答鎖沿いの任意の受信者に適用するかもしれない実装規定の指令を含めるのに使います。
すべての語用指令は、プロトコルの見地からの任意選択の動作を指定します。
しかし、システムによってはその動作が指令と一貫していることを要求しても'''構いません'''。
>
-Pragma = "Pragma" ":" 1#pragma-directive
>
- pragma-directive = "no-cache" | extension-pragma
-[DEL[extension-pragma = token [ "=" word ] ]]
-[INS[extension-pragma = token [ "=" ( token | quoted-string ) ] ]]
> When the [DEL["]]no-cache[DEL["]] directive is present in a request message, an
application [DEL[should]] [INS[SHOULD]] forward the request toward the origin server even
if it has a cached copy of what is being requested. [DEL[This allows a client to insist upon receiving an authoritative response to its request. It also allows a client to refresh a cached copy which is known to be corrupted or stale.]] [INS[This pragma directive has the same semantics as the no-cache cache-directive (see section 14.9) and is defined here for backward[DEL[s]] compatibility with HTTP/1.0. Clients SHOULD include both header fields when a no-cache request is sent to a server not known to be HTTP/1.1 compliant.]]
[CODE(HTTP)[no-cache]] 指令が要求メッセージに示されている時は、
[[応用]]は、たとえ要求されているもののキャッシュした複製を持っていたとしても、
その要求を[[起源サーバー]]に転送する'''べきです'''。[DEL[これによってクライアントはその要求に対する本家応答を受取ることを主張できます。クライアントが破壊されているまたは[[腐敗]]していると知っているキャッシュされた複製を更新することも可能になります。]] [INS[この語用指令は、 [CODE(HTTP)[no-cache]] [CODE(ABNF)[[[cache-directive]]]] と同じ意味を持ちまして、ここでは HTTP/1.0 との[[後方互換性]]のために定義します。クライアントは、 [CODE(HTTP)[no-cache]] 要求を HTTP/1.1 に従っていると分かっていないサーバーに送るときは両方の頭欄を含める'''べきです'''。]]
> Pragma directives [DEL[must]] [INS[MUST]] be passed through by a proxy or gateway
application, regardless of their significance to that application,
since the directives [DEL[may]] [INS[might [INS[{2616}]]]] be applicable to all recipients along the
request/response chain. It is not possible to specify a pragma for a
specific recipient; however, any pragma directive not relevant to a
recipient [DEL[should]] [INS[SHOULD]] be ignored by that recipient.
[CODE(HTTP)[Pragma]] 指令を、串や関門の応用は、その応用での重要度に拘らず、
次に渡さなければ'''なりません'''。なぜなら、指令は要求・応答鎖沿いのすべての受信者に適用可能かもしれないからです。
特定の受信者に語用を指定することはできません。しかし、受信者に関係のない語用指令はその受信者では無視する'''べきです'''。
[INS[
> [DEL[HTTP/1.1 clients SHOULD NOT send the Pragma request-header.]] HTTP/1.1
caches SHOULD treat "Pragma: no-cache" as if the client had sent
"Cache-Control: no-cache". No new Pragma directives will be defined
in HTTP.
;[DEL[HTTP/1.1 クライアントは [CODE(HTTP)[Pragma]] 要求頭を送る'''べきではありません'''。]]
HTTP/1.1 キャッシュは [CODE(HTTP)[Pragma: no-cache]] をクライアントが
[CODE(HTTP)[[[Cache-Control]]: no-cache]] を送ったのであるとして扱う'''べきです'''。
新しい [CODE(HTTP)[Pragma]] 指令は HTTP では定義されません。
[INS[
> Note: because the meaning of "Pragma: no-cache as a response
header field is not actually specified, it does not provide a
reliable replacement for "Cache-Control: no-cache" in a response [INS[(ママ)]]
注意: 応答頭欄としての [CODE(HTTP)[Pragma: no-cache]] の意味は実際には規定されていませんから、
応答中での [CODE(HTTP)[Cache-Control: no-cache]] の信頼できる置換は提供されません。
]INS]
]INS]
[INS[
注: 注記のない修正部は RFC 1945→2068 の変更点。
]INS]
]FIG]
[12] [CITE@en[RFC 3507 - Internet Content Adaptation Protocol (ICAP)]]
( ([TIME[2014-06-08 07:17:07 +09:00]] 版))
<http://tools.ietf.org/html/rfc3507#section-4.3.1>
* 統計
[8] [CITE@en[HTTP/1.1 Pragma header]] ([TIME[2009-07-19 11:31:44 +09:00]] 版) <http://www.http-stats.com/Pragma>
* 例
[9] >>8 より
>
* Pragma: no-cache
* Pragma: no-cache, xResetStrm=1
* Pragma: No-cache
* Pragma: cache
* Pragma: No-Cache
* Pragma: private
* Pragma: public
* Pragma: no-store
* Pragma: no-store, no-cache, must-revalidate
* Pragma: no cache
* Pragma: NO-CACHE
* Pragma: Private
* Pragma: no-cache, no-cache
* Pragma: no-cash
* Pragma: no-chache
* Pragma: no-store,no-cache
* Pragma: no_cache
* Pragma: nocache
[10]
[PRE(HTTP example code)[
Pragma: no-cache,rate=1.000000,stream-time=0,stream-offset=0:0,request-context=1,max-duration=0
Pragma: xClientGUID={baadc101-8645-d5a3-9571d14a66ea2b8f}
]PRE]
[305] [CITE@en[2.2.1.4 Pragma]]
( ([TIME[2014-10-09 13:56:33 +09:00]] 版))
<http://msdn.microsoft.com/en-us/library/cc251236.aspx>