You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thomas Scheffler <th...@uni-jena.de> on 2014/04/10 10:02:07 UTC

Tomcat 8.0.5 and web resource cache

Hi,

I recently noticed that Tomcat 8.0.5 does not invalidate cache entries 
for web resources.

Here are the steps to reproduce:

1. make "/foo.html" available through a jar file -> 
META-INF/resources/foo.html

2. Open foo.html in your browser

3. Add a new file "foo.html" inside you webapp directory with different 
content.

4. Refresh foo.html in your browser.

One would expect to see the content of the file that was added in step 
3. But Tomcat caches the URL it resolved in step 2 and sticks to it 
forever. This is new in Tomcat 8.

I would prefer that Tomcat always check the current webapp directory and 
uses it cache only for the *.jar files.

kind regards,

Thomas

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


Re: Tomcat 8.0.5 and web resource cache

Posted by Mark Thomas <ma...@apache.org>.
On 10/04/2014 02:02, Thomas Scheffler wrote:
> Hi,
> 
> I recently noticed that Tomcat 8.0.5 does not invalidate cache entries
> for web resources.

The cache has a default TTL of 5 seconds.

> Here are the steps to reproduce:
> 
> 1. make "/foo.html" available through a jar file ->
> META-INF/resources/foo.html
> 
> 2. Open foo.html in your browser
> 
> 3. Add a new file "foo.html" inside you webapp directory with different
> content.
> 
> 4. Refresh foo.html in your browser.
> 
> One would expect to see the content of the file that was added in step
> 3. But Tomcat caches the URL it resolved in step 2 and sticks to it
> forever. This is new in Tomcat 8.

The cache validation that occurs once the TTL has expired doesn't catch
this case but it should. I'll take a look.

Mark


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