Ajax cache problems in IE9 and IE9Ajax cache Problems
Use jQuery's getJSON to regularly retrieve data from the background and refresh the interface. When using the following methods, there is no problem in Chrome or Firefox, but the data cannot be refreshed in IE9.
$.getJSON(webApp + "/GetShowData.do?limit=" + limit,function(data){ //******************}
The reason is that, in IE9, if the Ajax request is the same as the previous request, it will not retrieve data from the browser, but directly obtain data from the local. Therefore, when a timestamp is added to a request, IE9 considers it a different request. The Code is as follows:
$.getJSON(webApp + "/GetHccShowData.do?" + new Date().getTime() + "limit=" + Hcc.limit,function(data){ //******************}
AJAX cache in IE
If AJAX is not used in combination with Web Services, it simply reads another page, which is the same effect for another page to be opened directly from a browser, therefore, your problem has nothing to do with the AJAX method itself, because AJAX is only responsible for reading. As for what the page provides to him, you need to solve the cache problem from the page itself.
The default cache settings are different for several browsers. You can directly add a disabled cache on the page.
HTML
<META HTTP-EQUIV = "pragma" CONTENT = "no-cache">
<META HTTP-EQUIV = "Cache-Control" CONTENT = "no-cache, must-revalidate">
<META HTTP-EQUIV = "expires" CONTENT = "Mon, 23 Jan 1978 12:52:30 GMT">
ASP
<%
Response. Expires =-1
Response. ExpiresAbsolute = Now ()-1
Response. cachecontrol = "no-cache"
%>
PHP
Header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT ");
Header ("Cache-Control: no-cache, must-revalidate ");
Header ("Pragma: no-cache ");
JSP
Response. setHeader ("Pragma", "No-Cache ");
Response. setHeader ("Cache-Control", "No-Cache ");
Response. setDateHeader ("Expires", 0 );
How to disable cache in C!
Response. Buffer = true;
Response. ExpiresAbsolute = System. DateTime. Now. AddSeconds (-1 );
Response. Expires = 0;
Response. CacheControl = "no-cache ";
Above
Jquery ajax cache Problems
If no additional settings are made, the cache will be used if the requested address is the same as the parameter and parameter value. I have met many of them.