Domanda

I have set in my mastersite of my asp.net application the following that the browser does not cache the pages and the user cannot navigate via back (and forward) buttons;

    Response.Cache.SetCacheability(HttpCacheability.NoCache)
    Response.Cache.SetExpires(Now.AddSeconds(-1))
    Response.Cache.SetNoStore()
    Response.AppendHeader("Pragma", "no-cache")

It's working on every site, but not on the first (that appears after a successful login).

If I navigate from the startpage to a random page and use the browser's back button, the back-transfer works. If I navigate from a random page to another random page it is not working.

In which cases the no cache option does not "disable" the browser's back button?

È stato utile?

Soluzione

no-cache does not disable the back button. It only disables the cache. The url history is still maintained. 'No caching' only means that when you go back, the page will be reloaded from the server and not from the cache.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top