Asp.net is the ultimate killer of disabling page caching for IE or Firefox

Source: Internet
Author: User

This function is described in this article as a solution to disable page caching. It is suitable for IE and Firefox browsers. The rational use of caching in Web development can effectively improve website performance, however, in some cases, cache may cause many problems. For example, the cache may cause repeated data submission and incorrect display of Verification Code images. In this case, we need to disable the page cache function.
 
Our common practice is to send a "no-Cache" command, but in actual use, we found that this command is valid for IE, but not for Firefox, this is because Firefox does not cache HTTPS pages but will still Cache HTTP pages. This is a bug in Firefox. The solution is simple, that is, replacing no-Cache with no-store, send no-store and no-Cache commands at the same time

In Asp.net, add the following to the page that does not require Caching:Code

Response. cache. setcacheability (system. Web. httpcacheability. nocache );
Response. cache. setnostore ();

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.