Ajax verification repeat issues in a timely manner

Source: Internet
Author: User

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 ()

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.