Re: Support for page/resource size

On Tue, Aug 12, 2014 at 2:07 PM, <> wrote:

> Another hole in the ResourceTiming API is that I can’t tell if objects
> requested via LINK rel=subresource were subsequently used by the page.
> ResourceTiming API treats preloaded resources the same as regular resources
> on that page. Also, there is no indicator that the initiator was a LINK
> tag.

Seems like an implementation bug. I think the spec covers this case
already: "If the initiator is an element, on getting, the initiatorType
attribute must return a DOMString with the same value as the localName of
that element."

Hint-initiated fetch should return "link". Yes, it doesn't tell you if it
was subresource or prefetch, but same constraint applies to other elements
(and CSS initiated downloads in particular). I'm not sure if we need to
expose more?

In summary, there is no way to figure out that preload hints were
> successfully used or not.

"Used" is complicated. Say I initiate the fetch via XHR (initiator:
xmlhttprequest)... how does the UA know when and if the response is "used"?
The app could fetch it, sniff the response, and throw it away - we wouldn't
know any better. Same for images: the resource is fetched but is inside a
hidden div which is never seen by the user - is that "used"? And so on.


Received on Tuesday, 12 August 2014 22:05:57 UTC