w3c / resource-timing

Resource Timing
https://w3c.github.io/resource-timing/
Other
119 stars 35 forks source link

Expose delivery type in PerformanceResourceTiming. #332

Closed jeremyroman closed 1 year ago

jeremyroman commented 2 years ago

This is an attempt to address both w3c/navigation-timing#163 and #303 by exposing a deliveryType attribute on PerformanceResourceTiming (as mentioned in https://github.com/w3c/resource-timing/issues/303#issuecomment-1099078362), 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" 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 commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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

noamr commented 2 years ago

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 commented 2 years ago

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:

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 commented 1 year ago

Blocked on https://github.com/w3c/resource-timing/issues/303

noamr commented 1 year ago

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.