we're trying to pin this down, and will be investigating more tomorrow, but we have noticed that in a particular area of our webapp, that a set of calls appear twice in the network log - once with a 404 - which does not appear to be wrapped correctly in testcafe proxy stuff (ie it doesn't start with the proxy bit, and cookies and so on are missing) - this one 404s, and then subsequently another correct one passes. The UI behaves as if nothing is wrong, but unfortunately it sets off alarms as it can cause 50+ 404s all at once - so looks like an attack. So we need to mitigate it or we won't be able to run the UI tests in higher environments - and the main reason for using this product is so we can. we are trying to understand why that particular piece of UI code does what it does (we have several teams). As preparation can you suggest information I can collect to determine what is happening. We are not going to be able to share a publicly accessible web app I'm afraid. I can send a Har file showing a small example of the issue.

Hi @zoejobson,Images into our proxy are loaded without proxying first time and if one of images cannot be loaded it is reloaded through proxy. It behavior accelerates proxy because usually images are loaded well without proxy.

There must be something more to it than that, I wrote a little test which logs into https://photos.google.com/ where there are a few images, they load as soon as you are logged in, and I see no sign of 404s interleaved in with the 200s

You won't always see the 404 error.First time, images are loaded into our proxy without proxying. If one of the images cannot be loaded directly, it is reloaded through the proxy - as described in the earlier post.This is the proxy's default behavior.

But there are two exceptions when an image is loaded through the proxy:

I notice that at least some of this feature is present in the alpha build. Could you explain to me how to use it to achieve what I want to achieve. That is. Our webapp gets a series of images when a report is run. WHen I run the report via test cafe each image is GOT twice, once without the proxy wrapper and with without our internal cookie, and once with the proxy wrapper (the cookie is not visible but it works anyway, so I'm assuming some sort of proxy magic). We need to be able to prevent testcafe from attempting to get these images without the correct authorisation (when wrapped in proxy stuff). Because doing so sets off alarms in our data dog as they look like attacks.

OK, I tried this purely as a diagnostic. The call we are having difficulty with gets an image on a report-image-generation/page/{id} but just prior to the page(image) call there is one to /layout/{id} This is my hook

When the test hits the layout one I get the console.log stuff (and hit breakpoints set in webstorm), but when it moves on to the page endpoint I get the unauthorised response from the request for the image - which I have been trying to fix, and you stated the hooks would be the solution for, and it doesn't retry with testcafes proxying [as it had been doing before], it doesn't hit my hook code at all.