JSON cache Problems

Source: Internet
Author: User

 

Call

$. Getjson ("$ {CTX }/Getdata. Action", {Topid: topid}, function (JSON ){

// Use the returned Data Update page

}

 

The page is cached, that is, the data remains unchanged after the user logs on.

I thought it was a JPA cache. disabling the JPA cache does not work.

I tried to disable the IE cache again. (Set in Browser IE options)

Therefore, the JSP settings page is not cached.

<Meta http-equiv = "Pragma" content = "no-Cache">
<Meta http-equiv = "cache-control" content = "no-Cache">
<Meta http-equiv = "expires" content = "0">

 

The problem was solved in this way, but the logon page still found to be cached.

Later, I suspect that the JSON cache is correct. After testing, the getjson callback method can be executed.

HoweverCodeIt is not executed, so the result is a JSON cache.

In

Printwriter out = response. getwriter ();
Out. Write (JSON );

Previously added Code to prohibit JSON caching

Response. setheader ("Pragma", "No-Cache ");
Response. setheader ("cache-control", "No-Cache ");
Response. setheader ("expires", "0 ");

 

Solve the problem.

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.