Jquery requests ie cache, data not updated [Ajax disables cache to solve the problem of IE data not updated]

Source: Internet
Author: User

running Ajax when the page is not refreshed, ie encounters Ajax cache, at the beginning, I didn't know ie I had to solve this problem for a long time. To sum up the solution:

InIEUseAjaxWhen a page is requested, the previous result is usually returned due to caching, resulting in confusion,[That isGetMethod, because the sending parameters and addresses are consistentIEThe browser retrieves data from the cache instead of requesting the server.PostThis problem does not occur because of different parameters.]WhileFF. To avoid cache impact, you can do this:

 

IEAccess Policy:InternetOption--Browsing History--Set-- InternetThe option of the temporary file is changed to "yes" every time you access the webpage.

 

1:InAjaxAdd a random function after the requested page,We can use random time functions.

InJavascriptSentURLAddT = math. Random ()

For example: URL + "&" + "t =" + math. Random ();OrNew Date ();

 

 InURLAdd"? Timestamp = "+ new date (). gettime ();

 The best method:

$. Ajaxsetup ({cache: false })

 In this way, allAjaxAll requests are executed. You don't have to modify the completedN... In progressPHProject

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.