Use timestamp to solve the problem of ie cache and timestamp to solve ie Cache

Source: Internet
Author: User

Use timestamp to solve the problem of ie cache and timestamp to solve ie Cache

In development and testing, if you select ie, When you edit a piece of data, you will find that the data in it is the same as before, in this case, the ie cache is solved. My method is to add a timestamp after the request link to avoid this problem.
Copy codeThe Code is as follows:
Var getTimestamp = new Date (). getTime (); // Timestamp
Var _ url = "$ {pageContext. request. contextPath}/productData/addShow. do? ProductDataId = "+ value +" & timer = "+ getTimestamp;


How to clear browser cache with EXTJS

Generally, timestamp is added. If you still execute it only once, it depends on your code logic. After timestamp is added, there will be no cache problems.
 
High score: js cache problems, urgent

Because of the IE cache, we always use IE cache when entering the same value. To solve this problem, you can use the following method:
1: Add a timestamp after the url submitted by ajax or dwr.
For example
Http_request.onreadystatechange = funcName (function name );
Http_request.open ("GET", url, true );
For example, the url is test. jsp.
So we add it after it? Time = new Date ();
Url = test. jsp? Time = new Date ();
2: Add a random number to the url.
.........
Url = test. jsp? Number = Math. random ();

Because the time and the number of requests are submitted once and changed once, each submission is not the same, and it will be executed as a new request.

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.