New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 597594 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

The script is downloaded twice

Reported by nives...@gmail.com, Mar 24 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

Steps to reproduce the problem:
1. Open HTML file
2. Check the network tab
3. Script is downloaded twice

What is the expected behavior?
Script is downloaded once.

What went wrong?
Script is downloaded twice

Did this work before? N/A 

Chrome version: 49.0.2623.87  Channel: stable
OS Version: OS X 10.10.5
Flash Version: Shockwave Flash 21.0 r0
 
js-twice-download.png
1.0 MB View Download
Even I get this behaviour randomly . Am not noticing this in other browsers. Sometimes  random scripts are being downloaded twice. 

Comment 2 by nives...@gmail.com, Mar 24 2016

i have attached screenshot for firefox Network panel.
firefox1.png
830 KB View Download
Labels: Needs-Feedback
Can you please provide a file where this problem replicates?

Comment 4 by nives...@gmail.com, Mar 24 2016

js3.html
1.2 KB View Download
@nivesoft : I tried executing your file. I did not get misbehaviour in normal window . But when I tried after switching to another person window, I got the issue while hard refresh( cmd + shift + R ) after 1 or 2 times. 
Components: Internals>Network
Status: Untriaged (was: Unconfirmed)
Can you also provide a network log when this happens so that we can see what's going on? This page describes how to provide network details: https://sites.google.com/a/chromium.org/dev/for-testers/providing-network-details.

Comment 7 by nives...@gmail.com, Mar 25 2016

I have attached network log file. check it.
net-internals-log (2).json
384 KB View Download

Comment 8 by nives...@gmail.com, Mar 25 2016

Most of the files are downloaded twice. Please check my above attached logs.
Screen Shot 2016-03-25 at 12.08.28 PM.png
1.4 MB View Download

Comment 9 by nives...@gmail.com, Mar 25 2016

We have analysed little detail, in order to find whether execution occur multiple times ? We put console log in each file and executed the same in our local, but the result seems to be fine. Yes, execution happening only once. But when we check our access log and chrome network panel seems download happening multiple times. Please refer the attached screenshots.
Screen Shot 2016-03-25 at 12.27.31 PM.png
1.4 MB View Download
Screen Shot 2016-03-25 at 12.27.58 PM.png
1.3 MB View Download
Screen Shot 2016-03-25 at 12.27.52 PM.png
1.0 MB View Download
Labels: -Needs-Feedback
Components: -Platform>DevTools -Internals>Network Blink>Loader
The resources are being requested with the BYPASS_CACHE load flag and the "Cache-Control: no-cache" request header.  Not something the network stack does itself, so these are combing from the renderer process somewhere.

Comment 12 Deleted

Comment 13 by nives...@gmail.com, Mar 30 2016

Is this a Blink loader(renderer) bug?
I have tried this in multiple browsers, Trident ( IE ), Gecko ( Firefox ), WebKit ( Safari ) and Blink ( Chrome and Opera ), I can able to reproduce this only in Chrome and Opera. So, both use Blink engine.
Any update?
Cc: bmcquade@chromium.org pmeenan@chromium.org japhet@chromium.org csharrison@chromium.org
Status: Available (was: Untriaged)
I can consistently reproduce this given the file provided in comment 4.

On first glance, it looks to me like we may be first requesting these files via the preload scanner, then re-requesting them when the parser actually needs them, rather than using the preload scanned versions. When the files are re-requested, I see them being requested in a stair-step in the waterfall that's consistent with the time that the parser requests them.

Adding pmeenan, japhet, and csharrison to get their take.

Where is the logic that tries to match parser requests with preload scanned responses? Do we have a sense for why it might not be matching these requests?

One subtle but perhaps important detail: the load flags for the parser requested version are load_flags = 258 (BYPASS_CACHE | VERIFY_EV_CERT) whereas the load flags from the preload scanned version, which is loaded first, are (BYPASS_CACHE | MAYBE_USER_GESTURE | VERIFY_EV_CERT). Perhaps we are encountering a miss because the load flags are different?
Thanks for looking into this. My guess is It's more likely due to the
double BYPASS_CACHE flags rather than MAYBE_USE_GESTURE on the second flag.
Is BYPASS_CACHE the correct flag here? These are just plain https script resources. Not clear why we'd be using bypass cache for those.
One more note: I would expect the second load of the resource, which seems to happen when the HTML parser encounters the script, to find the preloaded resource fetched during preload scanning, on the render process side, and not dispatch a second request down to net. So this seems like an issue on the render process side.
Pretty much all URL_REQUESTs have BYPASS_CACHE. Are you doing a shift-reload to trigger this? 
Owner: japhet@chromium.org
Yeah. mmenke noted the BYPASS_CACHE flag in his comment above as well. Perhaps the BYPASS_CACHE flag is not the real issue here.

For some reason the render-side logic to pair up preloaded requests doesn't seem to be doing so, as best I can tell.

Assigning to Nate just to get a sanity check on this, since I don't understand this code well.

Nate, which code in blink matches up preloads requested from the html preload scanner with the later use of that resource when e.g. the parser actually encounters a blocking script and needs to load it?

Do you have a sense as to whether/why we might be failing to match requests up in some cases, and allow the requests to fall through to the net stack?

Nate, please feel free to unassign once you've taken a look and left comments.

Thanks!
Yes, agreed.
By removing the "language" attribute on the scripts I've stopped the double downloading. I know exactly where that check is in the code though.
Sorry, that should say I *don't* know exactly where that check is in the code. I'm taking a look though.
I tested the script on TOT (#385459) and could not reproduce.

Comment 26 by nives...@gmail.com, Apr 14 2016

Is this Issue fixed in Version 50.0.2661.75 (64-bit)? Its working properly, Script is downloaded once. Thx.
Status: Fixed (was: Available)
Marking as fixed for now, given this doesn't repro anymore. Please re-open if you are able to repro on Chrome 51+.

Sign in to add a comment