What conditions cause the web browser to display a “Page Expired” message?

I assumed that sending the expiration page (a la) ...

    Response.Cache.SetExpires(System.DateTime.Now.AddSeconds(5));
    Response.Cache.SetCacheability(HttpCacheability.Public);
    Response.Cache.SetValidUntilExpires(true);

... would mean that if the user clicks the back button, they would see the message “Expired Page”. This seems to be not the case. I found that using the back button, the old (IMO expired) page will simply be displayed . In fact, when experimenting with various combinations of caching / non-caching and expiration time, I NEVER managed to get the "Expired Page" message from the browser.

What conditions cause this message?

ASP.Net server environment. I tested only in IE8 - I assume other browsers are compatible here.

+5
source share
2 answers

You can try setting these additional response headers:

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 
Pragma: no-cache

However, I do not think that there is a reliable way to prevent all browsers from reloading the page from the history.

+1
source

I think that after you there is a message that appears when you try to reload / refresh (or return) the page on which you posted the data (with a POST request in contrast to GET), therefore, since POST data can be "old" information, you get this warning.

0
source

All Articles