Comprehension of IResourceRequestHandler and interception of requests #3904
ordinaryorange
started this conversation in
General
Replies: 1 comment 5 replies
-
Check the log file and check DevTools to see if there are any clues as to what's going on. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently trying to do some request accounting. By that I mean tracking what requests are sent from the browser and what are received.
I'm overriding the
ResourceRequestHandler.OnBeforeResourceLoad
andResourceRequestHandler.OnResourceResponse
methods to track the requests and responses which mostly works, except for the following odd behaviour.For a particular page I'm logging requests & responses on, it issues requests for some fonts.
In my logs from CefSharp I see 2 entries from the
OnBeforeResourceLoad
(for the same Url) and only 1 log entry from theOnResourceResponse
method.I have been running all traffic through a proxy, and when I inspect those logs, the proxy confirms only 1 request/response was processed.
To investigate further, I hooked up the
ResourceRequestHandler.OnResourceLoadComplete
for logging as well.For every
OnBeforeResourceLoad
I see a corresponding log entry from theOnResourceLoadComplete
method.I have a suspicion that the first
OnBeforeResourceLoad
request is being handled by another subsystem possibly involved with a cache?, and the second then going out the network as a result of a failure of the first, and theOnResourceResponse
method is bypassed for non network responses ???. (but I'm speculating here)Am I wrong to expect a log from
OnResourceResponse
for everyOnBeforeResourceLoad
(excluding lost requests of course) ?If I'm correct about the cache thing, how do I account cache responses, if
OnResourceResponse
is not supposed to be called for cache events ?Beta Was this translation helpful? Give feedback.
All reactions