Disable cache settings on jsp pages
1. The client cache should include the following content in <META HTTP-EQUIV = "pragma" CONTENT = "no-cache">
<META HTTP-EQUIV = "Cache-Control" CONTENT = "no-cache, must-revalidate">
<META HTTP-EQUIV = "expires" CONTENT = "Wed, 26 Feb 1997 08:21:57 GMT">
Or
<Meta http-equiv = "pragma" content = "no-cache">
<Meta http-equiv = "cache-control" content = "no-cache">
<Meta http-equiv = "expires" content = "0">
2. Disable caching on the dynamic web page of the server. Add a script similar to the following:
Response. setHeader ("Pragma", "No-cache ");
Response. setHeader ("Cache-Control", "no-cache ");
Response. setDateHeader ("Expires", 0 );
3. Set a limited time Cache
Int minutes = 10;
Date d = new Date ();
String modDate = d. toGMTString ();
String expDate = null;
ExpDate = (new Date (d. getTime () + minutes * 60000). toGMTString ();
Response. setHeader ("Last-Modified", modDate );
Response. setHeader ("Expires", expDate );
Response. setHeader ("Cache-Control", "public"); /// HTTP/1.1
Response. setHeader ("Pragma", "Pragma"); /// HTTP/1.0
Suggestion: It is recommended that jsp cache be implemented on the filter, so that the pages to be buffered are concentrated in the same directory. You only need to modify web. xml to complete the buffer settings for each change, which is more convenient.
4. If none of the above methods works, add a tail after your normal URL.
Select in JS
Var timestamp = (new Date (). valueOf ();
URL + "& timestamp =" + timestamp;
Select
Long timestamp = new Date (). getTime ();
URL + "& timestamp =" + timestamp;
In this case, your URL is always changing, and the browser will have to update it honestly, and there is no buffer available.