0

I am working in Angular8. I am getting response from various APIs. But some how api request in Edge is not come from server. It was always fetch from cached. Below is screen shot of dev tool of IE Edge version 44 enter image description here

Same URL works in Chrome & Firefox as expected even in EdgeBeta it works.

Below are few points to note

  1. I am using http_Interceptor to add some customer headers in request(mainly auth Header). that code work as expected. but when request is actually send to server I don't see any headers attached in network tab of dev Tools for Edge browsers
  2. As shown in screen shot, Network tab always show "Received" column value form "Cache" even after I add Expires=-1 and pragma = "no-cache" headers. Theses headers are also not visible in networks tabs. I don't get any error while adding these headers in Interceptor methods.
  3. Even in Edge Dev tool I kept "Always refresh request from Server", edge is not sending request to sever.
  4. Issue is with only IE Edge (Microsoft Edge 44.17763.831.0). Did I miss any poly-fills to support Edge (version 44). chrome and EdgeBeta work as expected.

Any help is appreciated. Thanks in advances

Sanket
  • 83
  • 7
  • Have you tried to clear browser cache and test again? I see that there're errors in console in your Edge Legacy. Do the errors also show in other browsers? I suggest you to provide [a minimal code snippet](https://stackoverflow.com/help/minimal-reproducible-example) which can **reproduce** the issue. You can also use some online code editor to provide the code so that we can have a test and see how to help. – Yu Zhou Oct 27 '20 at 09:01
  • @Yu Zhou: Yes I tried clearing browser cache. Even you can see I have highlight tool to fech request always from server in screen shot. Those console error are other miscellaneous not because of code. (I check some value which are undefined hence those error are there in debug mode.) Apart from that I also send request by appending some dynamic querystring in URL like https://mydomain/api/v1/access?v=121212 - but still same result – Sanket Oct 27 '20 at 15:42
  • @yu Zhou: Code work as expected in Chrome, but not work with Edger few other oservations that I miss before .1) Code work in IE as soon as I start fiddle. 2. When Edge send request on protocal "Http/2" it works as expecetd. Generaly it works when fiddler is on. 3. The request I am sending to some different domain server, but no CORS related error is show in console. Also the server whom I am request is allowed to have request from my side as CORS is set to AllowAnyOrigin, AllowAnyHeader – Sanket Oct 27 '20 at 15:44
  • As it works with Fiddler, I think the issue may be related with proxy settings configured in Edge. Maybe some softwares or some codes are influencing the proxy setting. I also find [an article](https://www.telerik.com/blogs/help!-running-fiddler-fixes-my-app-) explaining in detail why Fiddler fixes apps. Besides, you say that it can work well with http/2, you can try to set Http settings in Internet Properties to force it use http/2. – Yu Zhou Oct 28 '20 at 07:47
  • Yes I saw that article too but not much usefull for me. – Sanket Oct 28 '20 at 12:55
  • As request is to CORS, I observe chrome is sending preflight request (Option method) to server, but edge is not sending same request. Instead showing response from cache and thorw exception in Ajax request. – Sanket Oct 28 '20 at 12:58
  • It's a known issue that Edge Legacy will only send the `GET` request and lead to the failure of other requests if you use CORS and request an untrusted origin. You can refer to [this thread](https://stackoverflow.com/questions/35176082/why-are-cors-requests-failing-in-microsoft-edge-but-working-in-other-browsers) to understand why CORS requests fail in Microsoft Edge but work in other browsers. – Yu Zhou Oct 29 '20 at 06:11
  • Edge Legacy also uses [Enhanced Protected Mode](https://learn.microsoft.com/en-us/archive/blogs/ieinternals/understanding-enhanced-protected-mode), the outcome is that: if the site is trusted, it will make two requests, `OPTIONS` and `GET`, but if it's not trusted, it only makes the `GET` request which causes it to fail. – Yu Zhou Oct 29 '20 at 06:12

0 Answers0