The cache of a page or user control refers to whether a page can be cached on a device within the response lifecycle of the page. These devices on the cache page include the browser that sends the request, the web server that responds to the request, and any device that can execute the cache in the request or response stream, such as the proxy server.
If the application determines the cacheability Based on runtime conditions (such as reading request headers), you can set the cacheability programmatically. For more information, see set page cache.
Set page cache by programming
In the Page code, call Object Attribute Method.
The following code willCache-controlSet the HTTP header .
|
|
Response.Cache.SetCacheability(HttpCacheability.Public); |
If Or PassSetcacheabilityTo prevent the requested browser from caching a page in its own history folder, when a user clicks the back or forward button at any time, the new version of the request response. By calling Attribute Method, andAllowParameter transferTrueValue, You can override this behavior according to the conditions.
If caching is set to DivisionNocacheOrServerandnocacheAny other value, ASP. NET will ignoreSetallowresponseinbrowserhistoryThe value set by the method.