Skip to content

Commit

Permalink
Add delivery type to PerformanceResourceTiming.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jeremyroman committed Aug 30, 2022
1 parent e71c2ab commit 77917b8
Showing 1 changed file with 45 additions and 5 deletions.
50 changes: 45 additions & 5 deletions index.html
Expand Up @@ -364,6 +364,7 @@ <h3>
[Exposed=(Window,Worker)]
interface PerformanceResourceTiming : PerformanceEntry {
readonly attribute DOMString initiatorType;
readonly attribute DOMString deliveryType;
readonly attribute ByteString nextHopProtocol;
readonly attribute DOMHighResTimeStamp workerStart;
readonly attribute DOMHighResTimeStamp redirectStart;
Expand All @@ -388,6 +389,11 @@ <h3>
<a data-dfn-for="PerformanceResourceTiming"><dfn>initiator
type</dfn></a>.
</p>
<p>
A <a>PerformanceResourceTiming</a> has an associated DOMString
<a data-dfn-for="PerformanceResourceTiming"><dfn>delivery
type</dfn></a>.
</p>
<p>
A <a>PerformanceResourceTiming</a> has an associated DOMString
<a data-dfn-for="PerformanceResourceTiming"><dfn>requested
Expand Down Expand Up @@ -549,6 +555,32 @@ <h3>
The setting of `initiatorType` is done at the different places where
a resource timing entry is reported, such as the [=fetch=] standard.
</p>
<p data-dfn-for="PerformanceResourceTiming">
<dfn>deliveryType</dfn> getter steps are to return the <a data-for=
"PerformanceResourceTiming">delivery type</a> for <a>this</a>.
</p>
<div class='note'>
<p>
`deliveryType` returns one of the following values:
</p>
<ul>
<li>
<code>"cache"</code>, if the <a data-for=
"PerformanceResourceTiming">cache mode</a> is not the empty
string.
</li>
<li>
the empty string <code>""</code>, if none of the above conditions
match.
</li>
</ul>

<p class='note'>
This is expected to be expanded by future updates to this
specification, e.g. to describe consuming preloaded resources and
prefetched navigation requests.
</p>
</div>
<p data-dfn-for="PerformanceResourceTiming">
The <dfn>workerStart</dfn> getter steps are to <a>convert fetch
timestamp</a> for <a>this</a>'s <a data-for=
Expand Down Expand Up @@ -1062,7 +1094,8 @@ <h2>
To <dfn data-export="">mark resource timing</dfn> given a [=/fetch
timing info=] |timingInfo|, a DOMString |requestedURL|, a DOMString
|initiatorType| a <a>global object</a> |global|, a string
|cacheMode|, and a [=/response body info=] |bodyInfo|, perform the
|cacheMode|, a [=/response body info=] |bodyInfo|, and an optional
[=string=] |deliveryType| (by default, the empty string), perform the
following steps:
</p>
<ol>
Expand All @@ -1071,8 +1104,8 @@ <h2>
</li>
<li>
<a>Setup the resource timing entry</a> for |entry|, given
|initiatorType|, |requestedURL|, |timingInfo|, |cacheMode|, and
|bodyInfo|.
|initiatorType|, |requestedURL|, |timingInfo|, |cacheMode|,
|bodyInfo|, and |deliveryType|.
</li>
<li>
<a data-cite=
Expand All @@ -1089,8 +1122,9 @@ <h2>
To <dfn data-export="">setup the resource timing entry</dfn> for
<a>PerformanceResourceTiming</a> |entry| given DOMString
|initiatorType|, DOMString |requestedURL|, [=/fetch timing info=]
|timingInfo|, a DOMString |cacheMode|, and a [=response body info=]
|bodyInfo|, perform the following steps:
|timingInfo|, a DOMString |cacheMode|, a [=response body info=]
|bodyInfo|, and an optional DOMString |deliveryType| (by default, the
empty string), perform the following steps:
</p>
<ol>
<li>Assert that |cacheMode| is the empty string or
Expand All @@ -1111,6 +1145,12 @@ <h2>
<li>Set |entry|'s <a data-for="PerformanceResourceTiming">cache
mode</a> to |cacheMode|.
</li>
<li>If |deliveryTode| is the empty string and |cacheMode| is not,
then set |deliveryTode| to "<code>cache</code>".
</li>
<li>Set |entry|'s <a data-for="PerformanceResourceTiming">delivery
type</a> to |deliveryType|.
</li>
</ol>
<p>
To <dfn>convert fetch timestamp</dfn> given {{DOMHighResTimeStamp}}
Expand Down

0 comments on commit 77917b8

Please sign in to comment.