1.meta method
Add the HTML header
<meta http-equiv= "Pragma" content= "No-cache" >
Description: Prevents the browser from accessing page content from the local computer's cache. The above settings, visitors will not be able to browse offline.
<meta http-equiv= "Cache-control" content= "No-cache,must-revalidate" >
Description: Cache-control Specifies the caching mechanism that the request and response follows, No-cache indicates that the request or response message cannot be cached, must-revalidate, for each request from the client, the proxy server must want the server to verify that the cache is outdated;
<meta http-equiv= "Expires" content= "0" >
Description: Can be used to set the expiration time of a Web page. Once the page expires, it must be retransmitted to the server.
Together , you will be able to re-enter the page you have visited, the browser must download the latest content from the server to achieve the effect of the refresh.
2. Clean up the temporary cache of form forms
document.getElementById ("Yourformid"). Reset ();
Description: JS resets the form (reset) method.
Add the autocomplete= ' off ' attribute to the form, or add the autocomplete= ' off ' attribute to input
Description: Turns off auto-fill.
3.jquery--ajax clearing the cache
A. Use Ajax to request the latest server files, plus the request headers if-modified-since and Cache-control, as follows:
$.ajax ({ URL:', dataType:' json ', beforesend:function (xmlHttp) { Xmlhttp.setrequestheader ("if-modified-since", "0"); Xmlhttp.setrequestheader ("Cache-control", "No-cache"); }, success:function (response) { } });
B. Direct use of Cache:false
$.ajax ({ URL:', dataType:' json ', Cache:false, success: Function (response) { } });
C. Avoid caching with random numbers or random times
$.ajax ({
Random number URL:' yoururl?ran= ' +math.random (), dataType:' json ', success: function(response) { } });
$.ajax ({
Random time URL:new date (). GetTime (), dataType:' json ', success: function(response) { } });
Several ways to clean up your browser's Web cache (meta,form form, Ajax)