-
Notifications
You must be signed in to change notification settings - Fork 41.9k
Description
WebMvcAutoConfiguration currently configures a lot of components that are specific to use of Spring MVC with a templating engine to produce server-side generated text/html content. An example of this is HiddenHttpMethodFilter, which is enabled by default. Such components present an unnecessary overhead when Spring MVC is solely used to produce e.g. application/json based APIs.
This has caught my attention after we discovered that the aforementioned HiddenHttpMethodFilter has been taking up to 80% of processing time on certain endpoints. While it was simple enough to disable the filter using spring.mvc.hiddenmethod.filter.enabled property, you have to do it in each project and I believe configuration could be made more lightweight there. In the case of this particular filter, a case could be made that it's not really needed even in all projects that use a templating engine.