tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@apache.org>
Subject Re: Any way to make tomcat send the "disable caching" headers on all responses?
Date Mon, 17 Aug 2009 15:38:13 GMT
Out of the box - no. But you can write a filter to add the response to 
all requests.

doFilter(...) {
   response.setHeader("Cache-Control","no-cache"); /* or no-store YMMV*/
   response.setHeader("Pragma","no-cache");
   response.setDateHeader ("Expires", 0);
   chain.doFilter();
}

-Tim

Epithemeus wrote:
> Hi all,
> 
> I've run into a similar problem with Tomcat 6.0 and am hoping to find some
> information on why this might be happening.
> 
> I have an xml file which contains information to display a graph. I also
> have an HTML file which creates an applet to view the graph.
> 
> The xml file is updated based on inputs from the user (specified in
> StartPage.jsp). So, the user gives an input, the xml file is updated and the
> corresponding graph should be displayed.
> 
> What is happening in practice is that: the xml file is indeed updated but
> the graph being displayed is an older version (corresponding to the older
> .xml file which has now been over-written). I gather that this means tomcat
> is caching the xml files.
> 
> I have tried including "cachingAllowed" to false in context.xml. I have also
> deleted the application_folder under $TOMCAT_HOME\work\Catalina\localhost\.
> Neither of these options has helped in disabling caching.
> 
> I would really appreciate any help on how I could get around this!
> 
> 


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


Mime
View raw message