We did lots of experiments on this, and simply adding the
<meta> tags does not work for all cases. Finally, we found
references on the web (I could dig them up if needed) that
it is documented that for some versions of IE, and some
versions of IIS (we run on Resin behind IIS), these headers
are simply ignored.
The solution that does work and is actually pretty simple
to implement was modifying the response itself (that is,
adding the no-cache information to the response, NOT as
<meta> tags in the HTML payload). In all our projects,
screens inherit from a single (usually empty) screen class;
we simply did this:
public class OurScreen
extends VelocityScreen
{
protected void doPostBuildTemplate( RunData data )
{
data.getResponse().setHeader("Cache-Control", "no-cache"); //HTTP
1.1
data.getResponse().setHeader("Pragma", "no-cache"); //HTTP 1.0
data.getResponse().setDateHeader("Expires", 0); //prevents caching
at the proxy server
}
}
>From our experience, that has worked in every case.
--
Gonzalo A. Diethelm
[EMAIL PROTECTED]
> -----Original Message-----
> From: Scott Eade [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 07, 2001 1:05 AM
> To: [EMAIL PROTECTED]
> Subject: Browser cache control
>
>
> Because the data changes all of the time, I need to instruct all
> browsers that surf to my turbine site to not use their cache nor
> any other cache that may be sitting in a proxy server between
> the browser and the web server. To do this I currently have:
>
> $page.setHttpEquiv("Cache-Control", "no-cache")
> $page.setHttpEquiv("Pragma", "no-cache")
>
> in my default page layout. This clearly adds:
>
> <meta content="no-cache" http-equiv="Cache-Control">
> <meta content="no-cache" http-equiv="Pragma">
>
> to the HTML output, but I am not sure if it is actually setting
> the HTTP headers - the behaviour I am seeing is that it is
> not.
>
> How can I set the actual HTTP headers so that the content
> expires immediately? Won't all template driven apps need
> to expire their content pretty much immediately?
>
> Thanks,
>
> Scott
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]