Ajax is often used on e-commerce websites. Today, we found that the registered account was not verified in time when it was re-registered. The verification result was passed and we checked the reason for the existence of JS cache, the solution is as follows:
1. If the Ajax method called in action is added before returnResponse. setheader ("Pragma", "No-Cache"); response. setheader ("cache-control", "No-Cache ");
Response. setdateheader ("expires", 0 );
2. Add
<Meta HTTP-EQUIV = "Pragma" content = "no-Cache">
<Meta HTTP-EQUIV = "cache-control" content = "no-Cache">
<Meta HTTP-EQUIV = "expires" content = "0">
3. Random numbers can be added to the called Js.
<SCRIPT type = "JavaScript" src = "test. js? Time = "+ new date ()> </SCRIPT>
4. A Random Number parameter can be added to the Request Path for accessing the action.
"XXX. do? OP = XX & time = "+ new date ()