w3c / resource-timing

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

Resource initiator information to enable creation of dependency trees #263

Open yoavweiss opened 3 years ago

yoavweiss commented 3 years ago

many years ago we talked about extending the initiator information that resource timing exposes to enable creation of dependency trees from RUM data. Those dependency trees could then enable better understanding of the resource loading of the page in the wild, and enable interesting analysis and optimizations.

For example, understanding which resources are responsible for the loading of others, can result in understanding that early discovery of the resources can speed up others, and encourage developers to preload them.

marcelduran commented 3 years ago

Here's the use case involving ServiceWorker I mentioned during last call:

I believe we have 2 contexts here: the page and the SW. IMO, regardless where RT entries are queried from, both should show foo.js as initiator. Reason being the fact that with a SW intercepting all requests, all entries would be pointing to sw.js which ultimately does not help building an accurate dependency tree.

nicjansma commented 3 years ago

Some thoughts on scenarios that a more accurate dependency tree could enable:

Would definitely love to see if this is a possibility!