Google is giving me mixed responses, so I am guessing it is highly browser subjective, but what would you recommend I put in (and also where) to stop pages caching?
A:
I've used:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
RC
2009-12-07 14:56:59
+1
A:
It's been a while, but when I used to do a lot of this, the advice was always to:
Set:
Cache-Control: no-cache
Expires: -1
Cache-Control: max-age -1
Here's a good article about the various nuances.
Benj
2009-12-07 14:59:50
Thanks for the link, a good read
SLC
2009-12-07 15:03:20
A:
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
or in ASP.NET, place this in your code behind (page or master page)
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1))
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetNoStore()
Matt Joslin
2009-12-07 15:07:17