You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Bhat, Deepak (STSD)" <bh...@hp.com> on 2006/05/17 08:28:41 UTC

Tomcat server seems to cache URLconnections for around 5 seconds.

Hi all,

	I am facing a problem with my application trying to retrieve
data through the tomcat server.My client side is an applet.The server
part of the code retrieves data & puts it in an xml file.The client
opens a URL connection to get the data from xml file.It is observed that
when the client is rapidly requesting for data(something like within 5
secs);the new data is not coming over to client side,inspite of the new
data being populated onto the xml file.
This problem does not seem to occur when the time duration for
subsequent requests are longer than 5 seconds.
  
The servlet contacts a data store and writes a file in xml format.This
file contains the data retrieved from the data store.It is placed at
some location on the server which is known to the client.

The application works as follows:-
1.Client(applet) sends a request to servlet  for data 2.Servlet gets
data from data store.
3.Servlet generates xml file and places it at some location.
4.Server sends a response to client.Response does not contain data
retrieved from the store.
5.Client issues a URI request to server(Tomcat 5.0) for this file.This
request does not go thru the servlet.
6.Client then parses this file and processes the data.
 
This file being generated is always at the same location.Filename does
not change either.
The write is guaranteed to complete before a read happens.No file locks
issue.
 
A typical request from applet goes out when a user clicks a
button.Then,steps 1 to 6 are performed.I observed that if the clicks are
spaced less than around 5 secs apart,the data from the previous request
was obtained again in spite of the file being rewritten with fresh data.
 
This happens inspite of browser cache being disabled and a setusecaches
field on client side being set to null.
  
The issue being faced is same as described in following :-
http://mail-archives.apache.org/mod_mbox/tomcat-dev/200209.mbox/%3c20020
902093213.3586.qmail@nagoya.betaversion.org%3e

I would like to know if the problem in above link was fixed in
subsequent tomcat versions.

I am using Tomcat 5.0.

Thanks & Regards,
Deepak

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


RE: Tomcat server seems to cache URLconnections for around 5 seconds.

Posted by "Bhat, Deepak (STSD)" <bh...@hp.com>.
Hi all,

Thanks for the help Mark,setting the cacheTTL to 0 solved the issue I
was facing.

Thanks & Regards,
Deepak 

-----Original Message-----
From: Mark Thomas [mailto:markt@apache.org] 
Sent: Wednesday, May 17, 2006 5:26 PM
To: Tomcat Developers List
Subject: Re: Tomcat server seems to cache URLconnections for around 5
seconds.

Bhat, Deepak (STSD) wrote:
> Hi all,
> 
> 	I am facing a problem with my application trying to retrieve
data 
> through the tomcat server.

This question belongs on the users list. Tomcat does cache static
resources and this is configured at the context level. See cacheTTL and
cachingAllowed on
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

If you have any additional questions, please address them to
users@tomcat.apapche.org

Mark

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


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


Re: Tomcat server seems to cache URLconnections for around 5 seconds.

Posted by Mark Thomas <ma...@apache.org>.
Bhat, Deepak (STSD) wrote:
> Hi all,
> 
> 	I am facing a problem with my application trying to retrieve
> data through the tomcat server.

This question belongs on the users list. Tomcat does cache static
resources and this is configured at the context level. See cacheTTL and
cachingAllowed on
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

If you have any additional questions, please address them to
users@tomcat.apapche.org

Mark

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