-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Inconsistent results for test_page_with_cached_script_javascript between chrome and firefox #48446
Comments
I quickly tested it and it seems Chrome sends a single request if multiple script elements request the same script (cached or non-cached, only 1 request is shown in DevTools/reaches the server). There are some in-memory caches that are currently underspecified but it sounds like sending fewer requests might be better (in terms of page load time). |
Related whatwg/html#6110 |
Thanks for checking! To be clear, when I am talking about performing a fetch, I don't necessarily mean that a request will be created. fetch can "fetch" directly from the cache without hitting the network. But the observable consequence will be that we will get dedicated network events in BiDi for the script tag. For another similar test I wanted to add (for cached images), it's actually mentioned in the spec that implementations might bypass fetch and directly reuse the list of available images for the document, and that the way this list is built and made available is implementation specific. So for this particular test I will not add it to the shared wdspec tests. But here for scripts it seems that the behavior with regards to fetch should be consistent across browsers? Unless as you said, this is due to the behavior of the in-memory caches, which is not clearly specified. And in this case, maybe caching tests for resources (JS, CSS, images) can't be written in a cross browser way. But that also means it will potentially lead to interop issues for folks writing tests involving such scenarios. |
yeah, I think this is what happens because DevTools also reports only a single network request. The second request is probably handled without issuing a new fetch and not reaching the CDP instrumentation point (which is before the fetch cache steps). Do I understand correctly that Firefox will issue two requests and both will be actually sent if caching is not configured by the server? |
Ah good idea, I'll have to check without caching on the server side. I imagine Firefox will perform 2 requests in that case, based on what the spec says. |
@OrKoN @sadym-chromium
We recently added new tests for cached network events for stylesheets, and the test at
wpt/webdriver/tests/bidi/network/response_completed/response_completed_cached.py
Line 453 in db4fbbb
Basically we load a page with 2 script tags pointing to the same (already cached) URL and Chrome in that case only emits a network event for 1 script request, while Firefox emits 2 events.
After checking internally on https://bugzilla.mozilla.org/show_bug.cgi?id=1922527 , it sounds like Firefox's behavior is correct, as each script should end up doing a main fetch. Can you check if this is correct and if there is potentially a bug on Chrome's side here?
The text was updated successfully, but these errors were encountered: