Closed
Description
Introduce a common cache, e.g. RequestMappingInfoCache
, that's stored as a request attribute (Spring MVC) or exchange attribute (WebFlux) to avoid repeated re-calculation of request related values required for condition checks.
There are already optimizations in WebFlux so request path, "Content-Type", and "Accept" are parsed only once, but even then "Accept" media types are sorted repeatedly + there are other recurring checks like isPreFlightRequest
. This would allow Spring MVC be more on par with WebFlux in terms of optimal request condition checks.
A lot of the base functionality could be in AbstractRequestCondition
with sub-classes accessing computeIfAbsent
type methods from the base class.