-
Notifications
You must be signed in to change notification settings - Fork 37
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
initiatorType definition doesn't define initiator in multiple element scenarios #54
Comments
I wrote up a short test at http://jsbin.com/tanuweletu/1/edit?html,console It seems like Firefox maintains "img" in that field, similar to WebKit's (not-yet-shipped) implementation. Blink's implementation OTOH is flaky and results in either "img" or "css" :/ |
My expectation matches @igrigorik |
Note that Microsoft Edge is "img" and only lists 1 resource timing. My 100% guesstimate on the basic structure of why most browsers would see 1 resource timing is that one download or the other kicks the download then the other one waits on the file until it completes. The "download" code is most likely recording the resource timing. |
It's not a second fetch served from one of the caches. The CSS url() is reusing the same resource object (similar to multiple |
But the reused resource must come from somewhere, right.. a shared cache? In this instances it's probably the memory cache, but it also doesn't have to be - e.g. evicted and falls through to HTTP cache. Fetch does not "explain" memory caches today, it should.. This is also related to w3c/preload#30. |
It is coming from the memory cache, but I don't think we want to expose each call to the memory cache in resource timing. (e.g. that's also where the preloader is placing preloaded resources, and where later DOM nodes find them when they are needed) FWIW, HTML has a concept of "list of available images" that touches on the memory cache a little (as some of the behavior there is Web exposed). But I totally agree that it should be more explicitly explained. |
I'm not saying we should expose calls to the memory cache. Rather, something triggers a request... that something is the initiator. Whether the response for this request comes from memory/http/whatever cache is beside the point. Also, there are probably some potentially privacy issues with leaking the "first" initiator for subsequent requests..? |
@yoavweiss assigning you as owner on this; I believe you had an AI from the F2F to write up how different browsers behave, what we want to see, etc? |
This is yet another side effect of the memory cache not being defined. |
While digging around WebKit's resource timing code, I realized that initiatorType is not well defined in scenarios where the same resource is requested by multiple initiators.
e.g. If an image is requested first by
<img>
and later on by a CSSurl()
, which initiator type should it have? To me it makes sense that it would be defined to be based on the first element that initiated that fetch, so in the above scenario it would be "img" rather than "css".The text was updated successfully, but these errors were encountered: