Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate HandlerMappingIntrospector Caching #14128

Closed
rstoyanchev opened this issue Nov 10, 2023 · 0 comments
Closed

Integrate HandlerMappingIntrospector Caching #14128

rstoyanchev opened this issue Nov 10, 2023 · 0 comments
Assignees
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Milestone

Comments

@rstoyanchev
Copy link
Contributor

rstoyanchev commented Nov 10, 2023

HandlerMappingIntrospector lookups may be performed multiple times per request. This is not good for performance and can become a hotspot, see spring-projects/spring-framework#31098.

HandlerMappingIntrospector now exposes a Filter to cache the results that Spring Security needs to use in order to optimize its performance. The change is available from 6.0.14, see spring-projects/spring-framework#31588 for details.

@rstoyanchev rstoyanchev added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Nov 10, 2023
@rwinch rwinch self-assigned this Nov 13, 2023
@rwinch rwinch added in: web An issue in web modules (web, webmvc) and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 28, 2023
rstoyanchev added a commit to spring-projects/spring-framework that referenced this issue Dec 11, 2023
Required by Spring Security to complete work on
spring-projects/spring-security#14128

The setCache and resetCache methods used from createCacheFilter are now
public. Generally they don't need to be used outside of the Filter if
only making checks against the current request. Spring Security, however,
makes additional checks against requests with alternative paths.
rstoyanchev added a commit to spring-projects/spring-framework that referenced this issue Dec 12, 2023
Required by Spring Security to complete work on
spring-projects/spring-security#14128

The setCache and resetCache methods used from createCacheFilter are now
public. Generally they don't need to be used outside of the Filter if
only making checks against the current request. Spring Security, however,
makes additional checks against requests with alternative paths.
@rwinch rwinch changed the title Integrate Filter to cache results of HandlerMappingIntrospector lookups Integrate HandlerMappingIntrospector Caching Dec 14, 2023
@rwinch rwinch added this to the 6.1.6 milestone Dec 14, 2023
@rwinch rwinch closed this as completed in 70dfb3d Dec 14, 2023
rwinch added a commit that referenced this issue Dec 15, 2023
By extending FilterChainProxy CompositeFilterChainProxy is more passive since
users often depend on the type of the springSecurityFilterChain Bean being
FilterChainProxy (even though it can already be other types - when debug is
enabled).

Issue gh-14128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Projects
Status: Done
Development

No branches or pull requests

2 participants