开发者

IE Ajax Temporary files issue

开发者 https://www.devze.com 2023-03-06 10:21 出处:网络
I have a BIG issue. I am creating an application completely made in Ajax, jQuery 1.3.2 + PHP. Everything works just fine in every browser.

I have a BIG issue. I am creating an application completely made in Ajax, jQuery 1.3.2 + PHP. Everything works just fine in every browser. But IE keeps using the temporary files and d开发者_如何学编程oes not show the changes made by the javascript and jQuery codes until I manually delete the temporary files! This is incredible!! How can I solve this issue? Please help me! IE will drive me crazy! Thank you


In my brief look I didn't see a duplicate of this, but I expect there is one.

But this is good:

how to clear the cache data when using ajax?

When you return your request use this header:

<?php header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");  

And when you make your request you can use this:

var url="UI/RoomDetailsView.jsp?ignoreMe=" + new Date().getTime();

Basically, turn off caching from the server and add a parameter that varies so the server will see something different and not use the cached version.


jQuery has a global setting that will get around caching by attaching a random string to the end of each AJAX request. Since the file names are now random no cached version can ever be called. Insert the following on any page and your caching issues should be resolved.

$.ajaxSetup ({
    cache: false
});
0

精彩评论

暂无评论...
验证码 换一张
取 消