How do I make sure that a website is loaded NOT from cache
My website homepage suupose to look different every time a user loads it. However, it loads from memory thus looks the same every time.
How can i make sure that it loads the new page and not the cached page?
开发者_如何学运维Thanks
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
in your code behind.
set your request header for caching with Cache-Control: no-cache and response headers as Pragma: no-cache. and expires:
Do you want to that programmatically or not?
Yes - Send HTTP headers that are about cache-control and expires.
No - Press shift before clicking the refresh button...this is to perform a hard reload.
精彩评论