Closed Bug 1945492 Opened 6 months ago Closed 6 months ago

Do not filter out subsequent cached requests for scripts

Categories

(DevTools :: Netmonitor, task)

task

Tracking

(firefox137 fixed)

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: arai, Assigned: arai)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Network Monitor filters out 2nd and subsequent cached requests. This behavior is inherited from the image cache's case, and this applies also to stylesheets, but scripts (from bug 1670403) should create multiple requests.
So, the following hasURI check shouldn't be performed if the request is initiated by script load.

https://searchfox.org/mozilla-central/rev/b1662b447f306e6554647914090d4b73ac8e1664/devtools/server/actors/resources/network-events-content.js#115-123

// Only one network request should be created per URI for resources from
// the cache
const hasURI = Array.from(this.networkEvents.values()).some(
  networkEvent => networkEvent.uri === channel.URI.spec
);

if (hasURI) {
  return;
}

https://searchfox.org/mozilla-central/rev/b1662b447f306e6554647914090d4b73ac8e1664/devtools/client/netmonitor/test/html_script-cache.html#3-10

<!--
    Loading the same file multiple times within the same document should
    generate multiple fetch, even when the script cache is used, and there
    should be 3 requests shown in the network monitor.
  -->
<script src="sjs_test-script.sjs"></script>
<script src="sjs_test-script.sjs"></script>
<script src="sjs_test-script.sjs"></script>

This behavior is tested by enabling the navigation cache, which is
tracked by bug 1670403.

Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/63d0be2d4590 Do not filter out subsequent cached requests for scripts. r=devtools-reviewers,jdescottes,ochameau
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: