views:

40

answers:

3

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
+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
Thanks for the link, a good read
SLC
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