In the past few days, we need to test the webpage and use XMLHTTP to discover that IE directly calls the cache.
For online viewing, most of them are solved by adding page parameters, such as pageid = xxxxxx, but it is very troublesome for the root page, such as www.google.cn.
As shown in the following example, Google and csdn use the pageid and head methods. the other is setRequestHeader, which is implemented by setting the request header. I personally hate a situation where I ask other people's questions, and I don't want to take a bubble and put a fart in the end. I have solved this problem by myself. This kind of person is basically share killer, which is a kind of selfish, as long as it gets it, it will never be paid. too many things are said.
I hate this because XMLHTTP is just a tool, and we should not spend a lot of time studying how to use it "smartly, to obtain a very small problem, such as cache, browser vendors should give methods to this common problem, rather than letting us waste time studying their tools. this is a waste of time.
Solution: IE7 and webbrowser are valid. If you haven't tried any other solutions, you can post your comments. Thank you.
The following setRequestHeader is the best choice.
Source: http://www.jb51.net/article/12336.htm (should not be the final source)
// _ Oxmlhttp is an XMLHTTP object <br/> _ oxmlhttp. abort (); <br/> _ oxmlhttp. open ("get", _ strsite, true); <br/> _ oxmlhttp. setRequestHeader ("no-Cache", "1"); <br/> _ oxmlhttp. setRequestHeader ("Pragma", "No-Cache"); <br/> _ oxmlhttp. setRequestHeader ("cache-control", "No-Cache"); <br/> _ oxmlhttp. setRequestHeader ("expire", "0"); <br/> _ oxmlhttp. setRequestHeader ("last-modified", "wed, 1 Jan 1997 00:00:00 GMT"); <br/> _ oxmlhttp. setRequestHeader ("If-modified-since", "-1"); <br/> _ oxmlhttp. onreadystatechange = _ yourcallbackfn; <br/> _ oxmlhttp. send ();