On 11/16/2012 2:38 PM, Jose María Zaragoza wrote:
Hi:

I'm using Tomcat 6  ( I don't remember the exact release, I hope to be
forgiven by Pid )

I need to modify Cache-Control header in some responses ( forcing them
to not be cached )
What is the best way to do it ?

a) To implement a Valve ( check request context path and if it match
,to modify response header )
b) To implement a filter
c) Others  ( any property in Tomcat's configuration files that I don't know )

Thanks and regards


Hi, Jose-

If you have access to the JSP or Java, you might use something like this:

    response.setHeader( "Expires", "-1" );
    response.setHeader( "Cache-Control", "no-cache" );

See http://docs.oracle.com/javaee/6/api/index.html?javax/servlet/http/HttpServletResponse.html

-Terence Bandoian


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to