Making webpages "out of date" in ASP. NET"
Making webpages "obsolete immediately" is sometimes a very useful function, for example, preventing users from using backend services to destroyProgramLogic, the Program actively Refreshes a page, and so on. The most effective method in ASP is:
Response. cachecontrol = " No-Cache "
In this case, response. expires =-1 is not required or meets our requirements.
But in the ASP. NET era, when I am still confused about using this statement, I found that the response field in msdn is described as follows:Sets the cache-control HTTP header to public or private.
[C #]
Public String cachecontrol {Get; set;} property value
"Public" or "private ".
Exceptions
Argumentexception: cachecontrol is an invalid Cache control value (not private or public ).
How can I only assign "public" and "private" values? However, one experiment knows that Ms is the publisher. As long as the HTTP Head Value of cache-control is valid, it is acceptable, including no-cache.
In addition, the functions of this method are still the same as those in ASP. Of course, it seems that. Net officially recommends this method:
Response. cache. setcacheability (system. Web. httpcacheability. nocache );
This effect is exactly the same as that of the former.
Finally, it seems that only IE is correct. Firefox does not buy this account ......