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

Issue 653088 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Throttled connection + disable cache + service worker results in duplicate requests

Project Member Reported by jakearchibald@chromium.org, Oct 5 2016

Issue description

https://cdn.rawgit.com/jakearchibald/9c269a5d97ecaadaa1a419995455d83d/raw/1ea36e15414c281f2976e068b8151c96466aca2b/

Run the above, ensure its service worker is installed.

Refresh the page with "disable cache" and "regular 3g" in devtools.

Some scripts appear to download twice, which is unusual.

Seen on 55.0.2881.0 canary (64-bit).
 
Screen Shot 2016-10-05 at 14.20.21.png
326 KB View Download
Owner: horo@chromium.org
Status: Assigned (was: Untriaged)
In my short observation varying the speed, the latest request which is in-flight when checking the latest script looks fired again.

horo-san: could you take a look?

Comment 2 by horo@chromium.org, Oct 6 2016

Cc: hirosh...@chromium.org pfeldman@chromium.org kouhei@chromium.org
Components: Internals>Preload
I think this is a problem of the way how HTMLResourcePreloader and InspectorNetworkAgent use MemoryCache.

1. When there is two <script> tags (without async), "second.js" is preloaded by
   HTMLResourcePreloader::preload(). And the script resource is stored in the
   MemoryCache.
    Example:
     <script src="first.js"></script>
     <script src="second.js"></script>

2. When Chrome finished loading (and executing) "first.js",
   HTMLScriptRunner::execute() takes "second.js" from the MemoryCache and execute.

3. One second after the page is loaded, Chrome starts a new ServiceWorker to
   check the script update.

4. While starting the new ServiceWorker, MemoryCache is cleared by
   MemoryCache::evictResources() twice.
    1. InspectorNetworkAgent::setCacheDisabled() calls MemoryCache::evictResources()
       while attaching the DevTools to the ServiceWorker.
    2. InspectorNetworkAgent::didCommitLoad() calls MemoryCache::evictResources()
       when the shadow page for the ServiceWorker is loaded by
       WebEmbeddedWorkerImpl::loadShadowPage()

If MemoryCache::evictResources() is called while loading (and executing) "first.js",
"second.js" is loaded from the server via the ServiceWorker again.

Comment 3 by horo@chromium.org, Oct 6 2016

Components: -Blink>ServiceWorker
I can reproduce this issue without ServiceWorker.
https://youtu.be/OLACsElqIUU

Comment 4 by horo@chromium.org, Oct 6 2016

Cc: horo@chromium.org
Owner: pfeldman@chromium.org
pfeldman@
I think this is an issue of "Disable cache" check box in DevTools.
Could you please handle this?

Comment 5 by horo@chromium.org, Oct 20 2016

 Issue 657914  has been merged into this issue.

Comment 6 by inian1...@gmail.com, Oct 20 2016

I am only able to reproduce the bug in my case (https://bugs.chromium.org/p/chromium/issues/detail?id=657914) only when both service worker and disable cache are enabled. Duplicate requests don't happen when I check the bypass for network option. 

Comment 7 by inian1...@gmail.com, Oct 28 2016

If I open Chrome with  open /Applications/Google\ Chrome\ Canary.app --args --disk-cache-dir=/dev/null --disk-cache-size=1 --media-cache-size=1
I am not able to reproduce the bug..
Cc: -kouhei@chromium.org -hirosh...@chromium.org cbentzel@chromium.org japhet@chromium.org
Owner: ----
Status: Available (was: Assigned)
cbentzel@, japhet@: I'm looking for someone to own disabled cache semantics as a service, in a way that is compatible with all network features (h2, service workers, etc). Who should own this?

Comment 9 by addyo@chromium.org, Mar 29 2017

Cc: addyo@chromium.org
Owner: horo@chromium.org
Status: Assigned (was: Available)
@horo: could you triage this?
Owner: jarhar@chromium.org

Sign in to add a comment