Throttled connection + disable cache + service worker results in duplicate requests |
||||||||
Issue descriptionhttps://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).
,
Oct 6 2016
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.
,
Oct 6 2016
I can reproduce this issue without ServiceWorker. https://youtu.be/OLACsElqIUU
,
Oct 6 2016
pfeldman@ I think this is an issue of "Disable cache" check box in DevTools. Could you please handle this?
,
Oct 20 2016
Issue 657914 has been merged into this issue.
,
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.
,
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..
,
Nov 21 2016
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?
,
Mar 29 2017
,
Dec 11 2017
@horo: could you triage this?
,
Dec 5
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by shimazu@chromium.org
, Oct 6 2016Status: Assigned (was: Untriaged)