25

I use Google Chrome's Network tab to collect network traces all the time. Roughly 50% of the time it works properly. Why do proxy tools like Charles Proxy and Fiddler successfully collect the data but the Chrome tool is inconsistent?

Importantly, I can't always get responses. Is it redirects? Something else?

Here is an example; I have several responses that have this message:

"Failed to load response data: No resource with given identifier found"

That is just one example, but in general, there are other messages and no response.

Is there a better plugin? I use SAML-tracer sometimes but it doesn't get responses, but it does have some data and works consistently. Is there a flag or setting I am missing?

2 Answers2

29

This problem seem to have been signaled in the bug report from 2012 (!)
Issue 141129: DevTools: XHR (and other resources) content not available after navigation.

The explanation by Chrome developer Eustas is :

What I see is that resources that hasn't been viewed in network panel will be inaccessible after page navigation.

This is an outcome of "low overhead" policy - resource content isn't transferred to DevTools until user explicitly want's to view it. This is done to avoid skewing measuring results.

Of course, we could keep resources even after navigation, but this will add memory burden: imagine, user (or site itself) continuously and indefinitely navigates...

Current solution is a good compromise: user can examine resources between navigations, if he likes; on the other side - user can examine network timing of multiple navigations on a single timeline.

The last comment in the post dates from 2022 :

While theoretically possible, it'd likely be a huge effort, and we won't have capacity to work on this any time soon.

The conclusion is that the problem is there to stay, so you can only use workarounds:

  • Use another browser (Firefox has good developer tools)
  • Add a breakpoint in the Sources tab:
    In Chrome DevTools, click on the "Sources" tab, expand "Event Listener Breakpoints", expand "Load" and check "beforeunload", then reload the request.
  • Use Postman to view response.

For more information on these workarounds, see the article
How to Fix Chrome’s Failed to Load Response Data Error.

harrymc
  • 498,455
3

Supplement to the above answer: This problem seems to occur only when Preserve log is enabled.

When i use Export HAR in devtools, i find this problem.

In addition, beforeunload breakpoints cannot resolve the problem that the response bar cannot be viewed when Preserve log is enabled.

hrdom
  • 77