/
541.txt
229 lines (167 loc) · 9.52 KB
/
541.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
* 仕様書
[REFS[
- [25] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2016-06-15 17:50:25 +09:00]]) <https://html.spec.whatwg.org/#link-type-preload>
- [33] [CITE@en[Preload]] ([TIME[2016-06-08 01:30:54 +09:00]]) <https://w3c.github.io/preload/>
]REFS]
* リンク型 [CODE(HTML)@en[preload]]
[26] [[リンク型]] [DFN[[CODE(HTML)@en[preload]]]] は、
指定された[[資源]]を[[利用者]]が必要とする可能性が高く、
予めこれを [[fetch]] して[[キャッシュ]]しなければ[MUST[ならない]]ことを示します [SRC[>>25]]。
[27] [[リンク型]] [CODE(HTML)@en[preload]] は、 [CODE(HTMLe)@en[link]]
[[要素]]で指定でき、[[外部資源リンク]]を作成します [SRC[>>25]]。
[28] この[[リンク型]]は [[body-ok]] です [SRC[>>25]]。つまりこの[[リンク型]]の
[CODE(HTMLe)@en[link]] [[要素]]は、 [CODE(HTMLe)@en[head]] [[要素]]内のみならず、
[CODE(HTMLe)@en[body]] [[要素]]内でも使えます。
* 実装
[36] [[Chrome]] は [CODE[load][onload]] からしばらくしてまだ [CODE[preload]]
した[[資源]]が未使用のままなら、これを[[開発者コンソール]]に報告します。
* 歴史
[6] [CITE@en[Resource Hints]]
( ([TIME[2014-08-05 22:14:16 +09:00]] 版))
<https://igrigorik.github.io/resource-hints/#preload>
[7] [CITE@en[''''''[''''''whatwg'''''']'''''' Preloading and deferred loading of scripts and other resources]]
( ([[Ian Hickson]] 著, [TIME[2014-08-23 09:44:23 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Aug/0177.html>
[8] [CITE@en[Resource Hints]]
( ([TIME[2014-10-17 03:41:00 +09:00]] 版))
<http://www.w3.org/TR/2014/WD-resource-hints-20141021/>
[1] [CITE@en[w3c/preload]]
([TIME[2015-04-01 14:44:38 +09:00]] 版)
<https://github.com/w3c/preload>
[2] [CITE@en[Preload]]
([TIME[2014-12-20 08:41:52 +09:00]] 版)
<https://w3c.github.io/preload/>
[3] [CITE@en[Add preload/prerender. Still need CSP alignment. See #36 · whatwg/fetch@26e5cca]]
([TIME[2015-04-05 18:50:18 +09:00]] 版)
<https://github.com/whatwg/fetch/commit/26e5cca8ab5bb4b68a8f238f41dd7364d8c276b3>
[4] [CITE@en[Resource Hints]]
([TIME[2015-04-23 05:55:03 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-resource-hints-20150422/>
[5] [CITE@en[Resource Hints]]
([TIME[2015-04-23 22:12:34 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-resource-hints-20150423/>
[9] [CITE[Issue 310450 - chromium - The default <video> preload value should be "metadata" - An open-source project to help move the web forward. - Google Project Hosting]]
([TIME[2015-07-15 12:23:20 +09:00]] 版)
<https://code.google.com/p/chromium/issues/detail?id=310450>
[10] [CITE@en[whatwg@whatwg.org from July 2015 by thread]]
([TIME[2015-07-15 11:01:28 +09:00]] 版)
<https://lists.w3.org/Archives/Public/public-whatwg-archive/2015Jul/thread.html>
[11] [CITE@en[Preload]]
( ([TIME[2015-07-20 23:28:59 +09:00]] 版))
<http://www.w3.org/TR/2015/WD-preload-20150721/>
[12] [CITE@en[Preload]]
([TIME[2015-07-24 02:05:46 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-preload-20150723/>
[13] [CITE@en[Preload]]
([TIME[2015-07-25 05:26:06 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-preload-20150724/>
[14] [CITE[IRC logs: freenode / #whatwg / 20150821]]
([TIME[2015-08-22 11:38:41 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20150821>
[15] [CITE@en[Suggest an invalid value default for preload attr · whatwg/html@651ea99]]
([TIME[2015-09-02 16:36:50 +09:00]] 版)
<https://github.com/whatwg/html/commit/651ea9976f8506b216851d9f52e11803fbe988e8>
[16] [CITE@en[Preload]]
([TIME[2015-09-02 00:53:01 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-preload-20150901/>
[17] [CITE@en[Revert "Suggest an invalid value default for preload attr" · whatwg/html@0a5aea3]]
([TIME[2015-09-22 11:28:34 +09:00]] 版)
<https://github.com/whatwg/html/commit/0a5aea3590336e260ffd8d35de84425360095520>
[18] [CITE@en[Preload]]
([TIME[2015-11-13 18:21:51 +09:00]] 版)
<https://w3c.github.io/preload/>
[19] [CITE@en[Preload]]
([TIME[2016-01-14 04:21:31 +09:00]] 版)
<https://www.w3.org/TR/2016/WD-preload-20160113/>
[20] [CITE@en[Merge pull request #42 from dret/patch-1 · w3c/preload@7bcdad7]]
([TIME[2016-01-20 17:36:05 +09:00]] 版)
<https://github.com/w3c/preload/commit/7bcdad7b093be1d5757fefe73e1facbb2a881e86>
[21] [CITE@en[Incorporating registration request feedback · w3c/preload@f848767]]
([TIME[2016-01-21 12:14:02 +09:00]] 版)
<https://github.com/w3c/preload/commit/f848767e3fbf7c53aa5a9aec663dd74e93bdafe3>
[22] [CITE@en[Preload]]
([TIME[2016-01-21 06:36:19 +09:00]] 版)
<https://www.w3.org/TR/2016/WD-preload-20160120/>
[FIG(quote)[
[FIGCAPTION[
[23] [CITE[Announcing Support for HTTP/2 Server Push]]
([TIME[2016-05-01 12:12:22 +09:00]] 版)
<https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2/>
]FIGCAPTION]
> So, if you want to push assets for a given request, you simply add a specially formatted Link header to the response:
> Link: </asset/to/push.js>; rel=preload;
]FIG]
[FIG(quote)[
[FIGCAPTION[
[24] [CITE[Announcing Support for HTTP/2 Server Push]]
([TIME[2016-05-01 12:12:51 +09:00]] 版)
<https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2/>
]FIGCAPTION]
> The Link header was originally designed to let browsers know that they should preload an asset. If you still need this behavior for legacy reasons, you can append the nopush directive to the header, like so:
> Link: </dont/want/to/push/this.css>; rel=preload; as=stylesheet; nopush
]FIG]
[29] [CITE@en[Add the "preload" link type]]
( ([[yoavweiss]]著, [TIME[2016-06-14 01:25:34 +09:00]]))
<https://github.com/whatwg/html/commit/d013cd1c329162270a219f450b88aa0dbea9d9bb>
[30] [CITE@en[Bug 158720 – Add support for <link rel=preload>]]
( ([TIME[2016-06-16 13:02:08 +09:00]]))
<https://bugs.webkit.org/show_bug.cgi?id=158720>
[31] [CITE@en[1222633 – Add support for <link rel=preload>]]
( ([TIME[2016-06-16 13:02:31 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=1222633>
[FIG(quote)[
[FIGCAPTION[
[32] [CITE@en-US[The status of Preload in Microsoft Edge is Under Consideration - Microsoft Edge Development]]
( ([TIME[2016-06-16 13:02:52 +09:00]]))
<https://developer.microsoft.com/en-us/microsoft-edge/platform/status/preload>
]FIGCAPTION]
> Roadmap Priority: Medium — Development is likely for a future release.
>
]FIG]
[FIG(quote)[
[FIGCAPTION[
[34] [CITE@en[GoogleChrome/http2-push-manifest: Generate a list of static resources for http2 push.]]
( ([TIME[2016-06-16 13:17:46 +09:00]]))
<https://github.com/GoogleChrome/http2-push-manifest>
]FIGCAPTION]
> Generates a list of local static resources used in your web app by outputting a json file. This file can be read by your web server to more easily construct the appropriate Link: <URL>; rel=preload; as=<TYPE> headers(s) for http2 push/preload.
]FIG]
[35] [CITE@en[Preload]]
([TIME[2016-12-01 02:37:41 +09:00]])
<https://www.w3.org/TR/2016/WD-preload-20161130/>
[37] [CITE@en[Fix up `type`,`media` and `href` processing (#87)]]
([[yoavweiss]]著, [TIME[2017-03-02 00:36:31 +09:00]])
<https://github.com/w3c/preload/commit/300b0e7d656dcb611a95c3c4f4bb7545fcc7fca7>
[38] [CITE@en[Align with w3c/hr-time#47]]
([[plehegar]]著, [TIME[2017-05-05 03:35:33 +09:00]])
<https://github.com/w3c/preload/commit/39acc002ccb2be1a19c214b0e26ce46f5038edc0>
[FIG(quote)[
[FIGCAPTION[
[39] [CITE@en[filamentgroup/loadCSS: A function for loading CSS asynchronously]]
([TIME[2017-05-17 18:37:44 +09:00]])
<https://github.com/filamentgroup/loadCSS>
]FIGCAPTION]
> LoadCSS is designed for loading CSS that is not critical to the initial rendering of the page, and desirable to load in an asynchronous manner. (For the critical CSS rules, we recommend either inlining that CSS in a style element, or referencing it externally and server-pushing it using http/2. Read more here)
> The standard markup pattern for loading files asynchronously is: <link rel="preload"> (W3C Spec). We recommend using this markup pattern to reference your non-critical CSS files. loadCSS and its rel=preload polyfill are designed to enable this markup to work in browsers that don't yet support this feature.
]FIG]
[40] [CITE@en[WebPerf Weekly Call -- 31 May 2017]]
([TIME[2017-06-01 03:03:39 +09:00]])
<https://www.w3.org/2017/05/31-webperf-minutes.html>
[41] [CITE@en[Update <link>'s processing model to work well for preload]]
([[domenic]]著, [TIME[2017-06-03 06:33:20 +09:00]])
<https://github.com/whatwg/html/commit/eb5d1cc61cdfe7d946618cc39a1f7c3e5904a03b>
[42] [CITE@en[Merge pull request #91 from domenic/fix-attribute-definition]]
([[yoavweiss]]著, [TIME[2017-06-03 06:36:38 +09:00]])
<https://github.com/w3c/preload/commit/01d2c0c7c44ee6340e4af179c9f3387f3d8a092f>
[43] [CITE@en[Add crossorigin attribute for as=fetch examples]]
([[yutakahirano]]著, [TIME[2017-06-27 19:17:31 +09:00]])
<https://github.com/w3c/preload/commit/bb9d49293f99b1c7ff6411e5ae37235cbade943c>
[44] [CITE@en[Add crossorigin attribute for as=fetch examples by yutakahirano · Pull Request #102 · w3c/preload]]
([TIME[2017-06-28 10:05:17 +09:00]])
<https://github.com/w3c/preload/pull/102>
[45] [CITE@en[Matching preload with different crossorigin attribute · Issue #100 · w3c/preload]]
([TIME[2017-06-28 10:05:52 +09:00]])
<https://github.com/w3c/preload/issues/100>
[46] [CITE@en['''['''Question''']'''In browser console, why request resource which is marked 'preload' in the html won't work? · Issue #2853 · whatwg/html]]
([TIME[2017-07-25 15:32:50 +09:00]])
<https://github.com/whatwg/html/issues/2853>