开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜