How can I make sure the site is NOT loaded from cache

My website homepage should look every time a user downloads it. However, it is loaded from memory, so it looks the same every time.

How can I make sure it loads a new page, not a cached page?

thank

+3
source share
3 answers

Do you want it programmatically or not?

Yes - Send HTTP headers that relate to cache management and expire.

No - click the "Change" button before clicking the update button ... this is to perform a hard reboot.

0
source
protected void Page_Load(object sender, EventArgs e)
{

 Response.Cache.SetCacheability(HttpCacheability.NoCache);
}

in your code.

+3
source

set the request header for caching using Cache-Control: no-cache and response headers as Pragma: no-cache. and expires:

+1
source

Source: https://habr.com/ru/post/1772801/


All Articles