Browser cache issue with Javascript

Hi,

We are trying to clear the Browser cache using javascript in IE10.

Approach we followed:

We are including the javascript files in the html files by passing some random number(12345678) dynamically, each and every time the page loads.

script type=“text/javascript” src="…/controllers/accountSearchController.js?12345678"
charset=“utf-8”>

It is clearing the cache dynamically for the parent window with out using the browser tools. But, for the popup window is concerned, we are not able to see the new changes getting affected.

Please suggest a solution on this ASAP.

Thanks,
Dileep Kumar P.

Hi,

I do not know if you use ajax GET call but I have had a similar problem when making popup window in IE which is solved by adding $.ajaxSetup({ cache: false }); to the begining of the script. It is IE which wants to make data load easier and it assumes that same data will be retrieved in same popup. In case of dynamic popup-ups it is not good idea.

It is possible to limit $.ajaxSetup({ cache: false }); to the specific popup in case that you do not want cancel cache for whole ajax.

http://forum.webix.com/discussion/2324/ie-problem-with-ajax#Item_2

We found for the very first time when we hit the URL freshly opening the browser, it is working as expected. But, when we made changes in the Javscript and do a test around to see the new changes, it is not working.

Even though we used the same mechanism placing $.ajaxSetup({ cache: false }); still, the scripts are remaining in the cache for the popup window.