I know this question has been asked a dozen times but in all the posts I can't find an answer that works for me.
I am trying to completly disable all cache from a page, so when the user goes back using the browser buttons, there appears the typical sign of "This page has expired".
rankor20
0 Points
4 Posts
How to disable cache
Jan 05, 2007 01:29 PM|LINK
I know this question has been asked a dozen times but in all the posts I can't find an answer that works for me.
I am trying to completly disable all cache from a page, so when the user goes back using the browser buttons, there appears the typical sign of "This page has expired".
So far I've tried the page directive:
<%@ OutputCache Duration="1" Location="None" %>
The Meta tags:
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
And the code:
Response.ExpiresAbsolute = DateTime.Now
Response.Expires = -1441
Response.CacheControl = "no-cache"
Response.AddHeader("Pragma", "no-cache")
Response.AddHeader("Pragma", "no-store")
Response.AddHeader("cache-control", "no-cache")
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetNoServerCaching()
But every time the back button is clicked, there appears the previost page.
How can I solve that?
Thanks