HI friends,
I want to know that what will happen when we write the code Response.Cache.SetNoStore()? Please explain in brief?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Mar 18, 2012, 11:49 PM
Prevents the browser from caching the ASPX page.
void Page_Load(Object sender, EventArgs e)
{
// Prevent the browser from caching the ASPX page
Response.Cache.SetNoStore();
}
please refer
http://msdn.microsoft.com/en-us/library/system.web.httpcachepolicy.setnostore.aspx
hope this help.
SenthilkumarPosted Mar 18, 2012, 3:01 AM
The ASP.Net has the facilities to cache the responses in several way.
It is the kind of mechanism to improve the performance of the web application. You know asp.net web pages are rendering from the server as per the request. You can say its request and response between the client browser and web server.
Some of the pages may have required to load the page again and again. Then you need some mechnisom to hold the response and later to post as response.Here cache comes into the picture. At the same time you need to clear the cache content and it will allows to process the request in the web iis.
The browser has its own cache to render and we need to control those activities.The HttpCachePolicy class has the method to set not to cache. Tje SetNoStore method in the HttpCachePolicy class has the control in the asp.net to ask the browser to not store the responses in its history.
// Prevent the browser from caching the ASPX page Response.Cache.SetNoStore();