-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Closed
Description
All http request served by tomcat will validateResource
,when StandardRoot has too many resouces(org.apache.catalina.webresources.StandardRoot#allResources
),the performance is slow. spring-boot 1.5.1 has the problem,allResources contains all classpath library. thanks committers ,this have been fixed at spring-boot 1.5.4.
but when app run in fatjar or war,resource can't be change anymore,tomcat org.apache.catalina.webresources.Cache#ttl
is too short(default is 5 second).
in my case ,i had set the cache as follows:
((TomcatEmbeddedServletContainerFactory)factory).addContextLifecycleListeners(
event -> {
if (event.getType().equals(Lifecycle.CONFIGURE_START_EVENT)) {
((StandardContext) event.getLifecycle())
.getResources()
.setCacheTtl(100l * 24 * 60 * 60 * 1000);//set cache ttl 100 days
}
});
can there be have some default strategy for this?
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement