Skip to content Skip to sidebar Skip to footer

Microsoft Edge Caching Ajax Requests?

So I have an ajax system for loading content on a website, it works like this: When clicking a button, a Javascript function is called: onclick='doSomething('abc')' My Javascript

Solution 1:

We had problems with cached ajax requests on Edge and IE 10/11 too. Our solution was the use of the HTTP-headerCache-Control: no-cache This works without a timestamp too.

Solution 2:

Yes, there is nothing inherent about XMLHttpRequest means it shouldn't be cached. Browsers treat them just like other HTTP requests. You can fully control how the browser caches your content using HTTP headers.

Solution 3:

The best way to disable cache in IE or MS Edge is to Do it:

Just press f12 , then go to network tab and find the forth button in tool box with this title : Always refresh from server .

It will send request each time with no cache .. enter image description here

Solution 4:

After a lot of searching and troubleshooting, I finally found the solution to fix this. Adding the header Cache-Control:no-cache did not work, it actually fouled up the troubleshooting in my case. I had used the header Pragma:no-cache to fix the same AJAX caching issue in IE11 but it still didn't work for Edge. And the Cache-Control header fixed it (to http 1.1 specs) for Chrome and FF.

According to a defect in the Microsoft database, the Pragma header is ignored if there is a Cache-Control header:

https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10739540/

So adding logic to only use Pragma for IE and Edge while only using Cache-Control for http 1.1 compliant broswers did the trick.

Post a Comment for "Microsoft Edge Caching Ajax Requests?"