0

I run a Java-based CMS which places cached images in the WEB-INF folder, specifically in /WEB-INF/imagecache/. Unfortunately, this directory gets extremely large with lots of nested paths, and Tomcat restarts become excruciatingly slow - setting the log level for org.apache.jasper.servlet.TldScanner.level to FINE shows why, there is a ton of messages like this:

16-Mar-2022 13:50:56.109 FINE [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/imagecache/<snip>/].

Is there any way to completely ban the TldScanner from specific directories?

user1933738
  • 235
  • 1
  • 5

1 Answers1

1

scanResourcePaths will always scan every directory and file under /WEB-INF/, except for /WEB-INF/classes/* and /WEB-INF/lib/*. These values are hardcoded into the code, so you can't change them.

A better option would be not polluting the WEB-INF directory, but instead specify an external directory for cache data. This has the bonus advantage of not losing all your cache if you need to redeploy the application for any reason.

Lacek
  • 6,585
  • 22
  • 28
  • Turned out the CMS has a config option for doing that... but too bad there is no filter option :( Thanks anyway! – user1933738 Mar 17 '22 at 16:28