RE: Delay / caching of resources?
From: Dennis Thrysøe [mailto:d...@geysirit.dk] However, when such HTML files are added or modified to the webapp (exploded directory) it takes something like 5 or 10 seconds before they can be served by tomcat. A wild stab in the dark based on something that happened to me... How are you adding the files to the webapp? In particular, are you referencing the folder via a network file system, and if so is there any clock skew between the server and the machine from which you're adding the files? This can cause odd timestamps on the new files, which may in turn lead to some applications not using them correctly if the timestamps are in the future as far as the server's concerned. If you're adding the files on the same machine, this doesn't apply and I'll crawl back under my rock ;-). - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Delay / caching of resources?
On 7Jan, 2009, at 10:45, Peter Crowther wrote: From: Dennis Thrysøe [mailto:d...@geysirit.dk] However, when such HTML files are added or modified to the webapp (exploded directory) it takes something like 5 or 10 seconds before they can be served by tomcat. A wild stab in the dark based on something that happened to me... How are you adding the files to the webapp? In particular, are you referencing the folder via a network file system, and if so is there any clock skew between the server and the machine from which you're adding the files? This can cause odd timestamps on the new files, which may in turn lead to some applications not using them correctly if the timestamps are in the future as far as the server's concerned. No, the webapp is local and the modifications (new files and/or altered content) actually come from a servlet in the same tomcat context. If you're adding the files on the same machine, this doesn't apply and I'll crawl back under my rock ;-). Thanks anyway :) -dennis -- Geysir IT d...@geysirit.dk http://geysirit.dk +45 31 51 60 00 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Delay / caching of resources?
On 7Jan, 2009, at 10:40, Dennis Thrysøe wrote: Hi, I have a tomcat 6 setup on linux (CentOS 5) and see some odd behaviour. There are some JSP's that include (in a custom tag with pageContext.include()) static HTML resources that are in the webapp. However, when such HTML files are added or modified to the webapp (exploded directory) it takes something like 5 or 10 seconds before they can be served by tomcat. Direct access to the filesystem sees the new file but tomcat says that the resource cannot be found. When modifying a HTML file tomcat keeps serving the old version for some seconds. The same seems to be a problem for images which are added to the webapp at runtime. These are requested directly (not included obviously). Changing the modificationTestInterval for the JSP servlet does not seem to have effect. (And the HTML is not served by the JSP servlet anyway, right?) I have now found a potential explanation with the help of a good debugger: StandardContext.setCacheTTL() This method seems to be altering the TTL of the context cache (ProxyDirContext via BaseDirContext) that is used by DefaultServlet which is serving my HTML files )from the default 5 seconds). I am, however, unable to find any configuration that can be used to control this caching? I am interested in getting the latest file version always. Otherwise I might need to implement serving of static resources in a servlet myself? Thanks, -dennis -- Geysir IT d...@geysirit.dk http://geysirit.dk +45 31 51 60 00 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Delay / caching of resources?
Dennis Thrysøe wrote: On 7Jan, 2009, at 10:40, Dennis Thrysøe wrote: Hi, I have a tomcat 6 setup on linux (CentOS 5) and see some odd behaviour. There are some JSP's that include (in a custom tag with pageContext.include()) static HTML resources that are in the webapp. However, when such HTML files are added or modified to the webapp (exploded directory) it takes something like 5 or 10 seconds before they can be served by tomcat. Direct access to the filesystem sees the new file but tomcat says that the resource cannot be found. When modifying a HTML file tomcat keeps serving the old version for some seconds. The same seems to be a problem for images which are added to the webapp at runtime. These are requested directly (not included obviously). Changing the modificationTestInterval for the JSP servlet does not seem to have effect. (And the HTML is not served by the JSP servlet anyway, right?) I have now found a potential explanation with the help of a good debugger: StandardContext.setCacheTTL() This method seems to be altering the TTL of the context cache (ProxyDirContext via BaseDirContext) that is used by DefaultServlet which is serving my HTML files )from the default 5 seconds). I am, however, unable to find any configuration that can be used to control this caching? I am interested in getting the latest file version always. Otherwise I might need to implement serving of static resources in a servlet myself? http://tomcat.apache.org/tomcat-6.0-doc/config/context.html Look for cachingAllowed Mark Thanks, -dennis -- Geysir IT d...@geysirit.dk http://geysirit.dk +45 31 51 60 00 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Delay / caching of resources?
From: Dennis Thrysøe [mailto:d...@geysirit.dk] Subject: Re: Delay / caching of resources? I have now found a potential explanation with the help of a good debugger: StandardContext.setCacheTTL() Who's calling that API? The only internal calls I find in Tomcat simply propagate the value from one context to another. I am, however, unable to find any configuration that can be used to control this caching? Look at the cacheTTL and cachingAllowed attributes: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Delay / caching of resources?
On 7Jan, 2009, at 15:44, Caldarale, Charles R wrote: From: Dennis Thrysøe [mailto:d...@geysirit.dk] Subject: Re: Delay / caching of resources? I have now found a potential explanation with the help of a good debugger: StandardContext.setCacheTTL() Who's calling that API? The only internal calls I find in Tomcat simply propagate the value from one context to another. That's what I was wondering. Some kind of reflective setting from the XML file I guess? I am, however, unable to find any configuration that can be used to control this caching? Look at the cacheTTL and cachingAllowed attributes: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html Thanks guys. I bet that'll help. I'll try it out right away. -dennis -- Geysir IT d...@geysirit.dk http://geysirit.dk +45 31 51 60 00 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org