Skip to content

Commit c2f56ef

Browse files
authored
Add delivery type to PerformanceResourceTiming. (#343)
* Add delivery type to PerformanceResourceTiming. This defines a concept of "delivery type" which currently describes the difference between resources delivered from the HTTP cache and those not (currently only detectable via transferSize). It is expected to be extended to describe resources delivered from other stores, such as the consuming resources from the HTML preload buffer and navigational prefetches. * add deliveryType to the list of attributes a UA may obscure
1 parent 98b0e13 commit c2f56ef

File tree

1 file changed

+46
-5
lines changed

1 file changed

+46
-5
lines changed

‎index.html

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ <h3>
355355
[Exposed=(Window,Worker)]
356356
interface PerformanceResourceTiming : PerformanceEntry {
357357
readonly attribute DOMString initiatorType;
358+
readonly attribute DOMString deliveryType;
358359
readonly attribute ByteString nextHopProtocol;
359360
readonly attribute DOMHighResTimeStamp workerStart;
360361
readonly attribute DOMHighResTimeStamp redirectStart;
@@ -381,6 +382,11 @@ <h3>
381382
<a data-dfn-for="PerformanceResourceTiming"><dfn>initiator
382383
type</dfn></a>.
383384
</p>
385+
<p>
386+
A <a>PerformanceResourceTiming</a> has an associated DOMString
387+
<a data-dfn-for="PerformanceResourceTiming"><dfn>delivery
388+
type</dfn></a>.
389+
</p>
384390
<p>
385391
A <a>PerformanceResourceTiming</a> has an associated DOMString
386392
<a data-dfn-for="PerformanceResourceTiming"><dfn>requested
@@ -552,6 +558,32 @@ <h3>
552558
The setting of `initiatorType` is done at the different places where
553559
a resource timing entry is reported, such as the [=fetch=] standard.
554560
</p>
561+
<p data-dfn-for="PerformanceResourceTiming">
562+
<dfn>deliveryType</dfn> getter steps are to return the <a data-for=
563+
"PerformanceResourceTiming">delivery type</a> for <a>this</a>.
564+
</p>
565+
<div class='note'>
566+
<p>
567+
`deliveryType` returns one of the following values:
568+
</p>
569+
<ul>
570+
<li>
571+
<code>"cache"</code>, if the <a data-for=
572+
"PerformanceResourceTiming">cache mode</a> is not the empty
573+
string.
574+
</li>
575+
<li>
576+
the empty string <code>""</code>, if none of the above conditions
577+
match.
578+
</li>
579+
</ul>
580+
581+
<p>
582+
This is expected to be expanded by future updates to this
583+
specification, e.g. to describe consuming preloaded resources and
584+
prefetched navigation requests.
585+
</p>
586+
</div>
555587
<p data-dfn-for="PerformanceResourceTiming">
556588
The <dfn>workerStart</dfn> getter steps are to <a>convert fetch
557589
timestamp</a> for <a>this</a>'s <a data-for=
@@ -1030,7 +1062,8 @@ <h4>
10301062
<p>
10311063
The user agent MAY still enforce cross-origin restrictions and set
10321064
transferSize, encodedBodySize, and decodedBodySize attributes to
1033-
zero, even with Timing-Allow-Origin HTTP response header fields.
1065+
zero, even with Timing-Allow-Origin HTTP response header fields. If
1066+
it does, it MAY also set deliveryType to "".
10341067
</p>
10351068
<p>
10361069
The <a>Timing-Allow-Origin</a> headers are processed in
@@ -1130,8 +1163,9 @@ <h2>
11301163
To <dfn data-export="">mark resource timing</dfn> given a [=/fetch
11311164
timing info=] |timingInfo|, a DOMString |requestedURL|, a DOMString
11321165
|initiatorType| a <a>global object</a> |global|, a string
1133-
|cacheMode|, a [=/response body info=] |bodyInfo|, and a
1166+
|cacheMode|, a [=/response body info=] |bodyInfo|, a
11341167
<a data-cite="FETCH#concept-status">status</a> |responseStatus|,
1168+
and an optional [=string=] |deliveryType| (by default, the empty string),
11351169
perform the following steps:
11361170
</p>
11371171
<ol>
@@ -1141,7 +1175,7 @@ <h2>
11411175
<li>
11421176
<a>Setup the resource timing entry</a> for |entry|, given
11431177
|initiatorType|, |requestedURL|, |timingInfo|, |cacheMode|,
1144-
|bodyInfo| and |responseStatus|.
1178+
|bodyInfo|, |responseStatus|, and |deliveryType|.
11451179
</li>
11461180
<li>
11471181
<a data-cite=
@@ -1159,8 +1193,9 @@ <h2>
11591193
<a>PerformanceResourceTiming</a> |entry| given DOMString
11601194
|initiatorType|, DOMString |requestedURL|, [=/fetch timing info=]
11611195
|timingInfo|, a DOMString |cacheMode|, a [=response body info=]
1162-
|bodyInfo|, and a <a data-cite="FETCH#concept-status">status</a>
1163-
|responseStatus|, perform the following steps:
1196+
|bodyInfo|, a <a data-cite="FETCH#concept-status">status</a>
1197+
|responseStatus|, and an optional DOMString |deliveryType| (by
1198+
default, the empty string), perform the following steps:
11641199
</p>
11651200
<ol>
11661201
<li>Assert that |cacheMode| is the empty string,
@@ -1184,6 +1219,12 @@ <h2>
11841219
<li>Set |entry|'s <a data-for="PerformanceResourceTiming">response
11851220
status</a> to |responseStatus|.
11861221
</li>
1222+
<li>If |deliveryType| is the empty string and |cacheMode| is not,
1223+
then set |deliveryType| to "<code>cache</code>".
1224+
</li>
1225+
<li>Set |entry|'s <a data-for="PerformanceResourceTiming">delivery
1226+
type</a> to |deliveryType|.
1227+
</li>
11871228
</ol>
11881229
<p>
11891230
To <dfn>convert fetch timestamp</dfn> given {{DOMHighResTimeStamp}}

0 commit comments

Comments
 (0)