You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jossie Mann <Jo...@Sun.COM> on 2004/04/17 00:26:54 UTC

No-cache headers

Currently I've got the following code in teh pageBeginRender of one of 
my pages. Instead of just disabling caching for one page however, I want 
to disable it in all the pages.  I searched through the forums, and saw 
that I could put in the ApplicationServlet, but which method should I 
override to do this.

HttpServletResponse response = cycle.getRequestContext().getResponse();
         response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
         response.setHeader("Cache-Control", "no-store, no-cache, 
must-revalidate");
         response.setHeader("Cache-Control", "post-check=0, pre-check=0");
         response.setHeader("Pragma", "no-cache");




Thanks,

Jossie



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: No-cache headers

Posted by Paul Ferraro <pm...@columbia.edu>.
I'd recommend using a javax.servlet.Filter to do this.  See the 
following link for an example implementation:
http://www.onjava.com/pub/a/onjava/2004/03/03/filters.html

Paul

Jossie Mann wrote:

> Currently I've got the following code in teh pageBeginRender of one of 
> my pages. Instead of just disabling caching for one page however, I 
> want to disable it in all the pages.  I searched through the forums, 
> and saw that I could put in the ApplicationServlet, but which method 
> should I override to do this.
>
> HttpServletResponse response = cycle.getRequestContext().getResponse();
>         response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
>         response.setHeader("Cache-Control", "no-store, no-cache, 
> must-revalidate");
>         response.setHeader("Cache-Control", "post-check=0, pre-check=0");
>         response.setHeader("Pragma", "no-cache");
>
>
>
>
> Thanks,
>
> Jossie
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org