Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose delivery type in PerformanceResourceTiming. #332

Closed
jeremyroman opened this issue Jul 6, 2022 · 7 comments
Closed

Expose delivery type in PerformanceResourceTiming. #332

jeremyroman opened this issue Jul 6, 2022 · 7 comments
Assignees

Comments

@jeremyroman
Copy link
Contributor

This is an attempt to address both w3c/navigation-timing#163 and #303 by exposing a deliveryType attribute on PerformanceResourceTiming (as mentioned in #303 (comment)), specifically the entry that may consume (rather than populate) a cache. This doesn't preclude timing entries being available for the request which populates the cache, if appropriate.

It would be one of the following DOMStrings:

  • "navigational-prefetch", which would be used for the cases in How should prefetch be exposed? navigation-timing#163. Algorithms which use a prefetched response during navigation would call mark resource timing with this delivery type.
  • "preload", which would be passed by consume a preloaded resource
  • "cache", which would apply if the cache mode is non-empty (i.e., the resource came from the cache)
  • the empty string, if none of the above apply. We could alternatively call this "network" or similar, but this has precedent in cache mode, is perhaps less misleading if new delivery types aren't immediately supported, and is false-ish, similar to if the the property is absent.

"navigational-prefetch" could be temporarily left out of the spec proper and instead kept as a monkey-patch in the proposals for specifying navigational prefetch, but I've included it for now.

"preload" could also land as a separate normative change coordinated with its own HTML and WPT pull requests.

@jeremyroman
Copy link
Contributor Author

@yoavweiss @noamr Trying to unblock these two issues; wdyt?

The delta to this specification is fairly small: https://github.com/w3c/resource-timing/compare/gh-pages...jeremyroman:resource-timing:resource-timing-prefetch?expand=1

@yoavweiss
Copy link
Contributor

Right now, consuming a preloaded resource doesn't create an entry. Modifying that would require some discussion, which started in #303. IIUC, your proposal here matched @noamr's "separate entry" proposal. Is that correct?

@jeremyroman
Copy link
Contributor Author

jeremyroman commented Jul 6, 2022

Yes, I propose that consuming a preloaded resource create a separate entry, like Noam's separate entry proposal.

@noamr
Copy link
Contributor

noamr commented Jul 6, 2022

Yes I think we should have separate entries for each fetch and separate them by something like this proposal. Not sure how to advance towards a consensus on #303 though.

@jeremyroman
Copy link
Contributor Author

jeremyroman commented Jul 6, 2022

I defer to you and Yoav about what the right process is within Web Perf WG (CONTRIBUTING.md seems to say "enough support" after review by WG participants), but it seems like a proposal like this one would:

  • make it easy for authors/RUM libraries to filter out the preload consume records if they wanted to
  • be consistent with how cached resources work, give flexibility moving forward about whether/how to expose the timing of the underlying navigational prefetch itself (whether it's shown to the referring page, the destination page, neither or both), and
  • address the problem in How should prefetch be exposed? navigation-timing#163 (performance.getEntriesByType('navigation')[0].deliveryType === 'navigational-prefetch')

My preferred way of making forward progress is to make a concrete proposal (this one, adapted from the linked comment), solicit feedback (maybe this needs to go to a WPWG F2F? unsure about process) and then write tests (per CONTRIBUTING.md) and try to merge it.

@noamr
Copy link
Contributor

noamr commented Jul 18, 2022

Blocked on #303

@noamr
Copy link
Contributor

noamr commented Aug 24, 2022

Since I was not able to advance #303 recently, I propose this goes ahead, and we coordinate that it has #303 in mind to keep consistency in naming and meanings.

aarongable pushed a commit to chromium/chromium that referenced this issue Sep 20, 2022
A new DOM string `deliveryType` in installed on
`PerformanceResourceTiming` to differentiate the where the resources are
from. In this CL `deliveryType` unconditionally returns an empty string.
Meaningful definitions will be populated in the upcoming CLs.

See w3c/resource-timing#332


LOW_COVERAGE_REASON=deliveryType will be populated in coming CLs with
WPTs.

Bug: 1358591
Change-Id: I2dd975d7304397fb2bbbec3e2fb13617678b3555
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3899872
Reviewed-by: Jeremy Roman <[email protected]>
Commit-Queue: William Liu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1049368}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 26, 2022
Per w3c/resource-timing#332, deliveryType will have value "cache" if the resource's cache state is either kLocal or kValidate; else deliveryType will return an empty string.

The WPT will remain tentative until the spec is updated.

Associated WPT PR: github.com//pull/36072

Bug: 1358591
Change-Id: Ibdf2668569dc1b91bd66b8c11c0f28820057b364
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 26, 2022
Per w3c/resource-timing#332, deliveryType will have value "cache" if the resource's cache state is either kLocal or kValidate; else deliveryType will return an empty string.

The WPT will remain tentative until the spec is updated.

Bug: 1358591
Change-Id: Ibdf2668569dc1b91bd66b8c11c0f28820057b364
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 26, 2022
Per w3c/resource-timing#332, deliveryType will
have value "cache" if the resource's cache state is either kLocal or
kValidate; else deliveryType will return an empty string.

The WPT will remain tentative until the spec is updated.

Bug: 1358591
Change-Id: Ibdf2668569dc1b91bd66b8c11c0f28820057b364
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 30, 2022
Per w3c/resource-timing#332, deliveryType will
have value "cache" if the resource's cache state is either kLocal or
kValidate; else deliveryType will return an empty string.

The WPT will remain tentative until the spec is updated.

Bug: 1358591
Change-Id: Ibdf2668569dc1b91bd66b8c11c0f28820057b364
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 30, 2022
Per w3c/resource-timing#332, deliveryType will
have value "cache" if the resource's cache state is either kLocal or
kValidate; else deliveryType will return an empty string.

The WPT will remain tentative until the spec is updated.

Bug: 1358591
Change-Id: Ibdf2668569dc1b91bd66b8c11c0f28820057b364
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 30, 2022
Per w3c/resource-timing#332, deliveryType will
have value "cache" if the resource's cache state is either kLocal or
kValidate; else deliveryType will return an empty string.

The WPT will remain tentative until the spec is updated.

Bug: 1358591
Change-Id: Ibdf2668569dc1b91bd66b8c11c0f28820057b364
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 30, 2022
Per w3c/resource-timing#332, deliveryType will
have value "cache" if the resource's cache state is either kLocal or
kValidate; else deliveryType will return an empty string.

The WPT will remain tentative until the spec is updated.

Bug: 1358591
Change-Id: Ibdf2668569dc1b91bd66b8c11c0f28820057b364
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3913675
Commit-Queue: William Liu <[email protected]>
Reviewed-by: Jeremy Roman <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1053792}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 30, 2022
Per w3c/resource-timing#332, deliveryType will
have value "cache" if the resource's cache state is either kLocal or
kValidate; else deliveryType will return an empty string.

The WPT will remain tentative until the spec is updated.

Bug: 1358591
Change-Id: Ibdf2668569dc1b91bd66b8c11c0f28820057b364
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3913675
Commit-Queue: William Liu <[email protected]>
Reviewed-by: Jeremy Roman <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1053792}
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
A new DOM string `deliveryType` in installed on
`PerformanceResourceTiming` to differentiate the where the resources are
from. In this CL `deliveryType` unconditionally returns an empty string.
Meaningful definitions will be populated in the upcoming CLs.

See w3c/resource-timing#332

LOW_COVERAGE_REASON=deliveryType will be populated in coming CLs with
WPTs.

Bug: 1358591
Change-Id: I2dd975d7304397fb2bbbec3e2fb13617678b3555
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3899872
Reviewed-by: Jeremy Roman <[email protected]>
Commit-Queue: William Liu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1049368}
NOKEYCHECK=True
GitOrigin-RevId: d17c88278ec4e11bd6363dea1c22afc6ca0a9394
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
Per w3c/resource-timing#332, deliveryType will
have value "cache" if the resource's cache state is either kLocal or
kValidate; else deliveryType will return an empty string.

The WPT will remain tentative until the spec is updated.

Bug: 1358591
Change-Id: Ibdf2668569dc1b91bd66b8c11c0f28820057b364
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3913675
Commit-Queue: William Liu <[email protected]>
Reviewed-by: Jeremy Roman <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1053792}
NOKEYCHECK=True
GitOrigin-RevId: a891de1d49ac2b5a35dea2a5201812beea12f321
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 21, 2022
…cache"., a=testonly

Automatic update from web-platform-tests
Populate `deliveryType` with the value "cache".

Per w3c/resource-timing#332, deliveryType will
have value "cache" if the resource's cache state is either kLocal or
kValidate; else deliveryType will return an empty string.

The WPT will remain tentative until the spec is updated.

Bug: 1358591
Change-Id: Ibdf2668569dc1b91bd66b8c11c0f28820057b364
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3913675
Commit-Queue: William Liu <[email protected]>
Reviewed-by: Jeremy Roman <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1053792}

--

wpt-commits: 31e0a719bc4d9f87dfdf303241efba22fcc2ccdf
wpt-pr: 36073
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Oct 26, 2022
…cache"., a=testonly

Automatic update from web-platform-tests
Populate `deliveryType` with the value "cache".

Per w3c/resource-timing#332, deliveryType will
have value "cache" if the resource's cache state is either kLocal or
kValidate; else deliveryType will return an empty string.

The WPT will remain tentative until the spec is updated.

Bug: 1358591
Change-Id: Ibdf2668569dc1b91bd66b8c11c0f28820057b364
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3913675
Commit-Queue: William Liu <[email protected]>
Reviewed-by: Jeremy Roman <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1053792}

--

wpt-commits: 31e0a719bc4d9f87dfdf303241efba22fcc2ccdf
wpt-pr: 36073
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants