Skip to content

useCaches option in PathMatchingResourcePatternResolver not applied in special case#35465

Closed
reckart wants to merge 1 commit into
spring-projects:mainfrom
reckart:bugfix/35464-useCaches-option-in-PathMatchingResourcePatternResolver-not-applied-in-special-case
Closed

useCaches option in PathMatchingResourcePatternResolver not applied in special case#35465
reckart wants to merge 1 commit into
spring-projects:mainfrom
reckart:bugfix/35464-useCaches-option-in-PathMatchingResourcePatternResolver-not-applied-in-special-case

Conversation

@reckart

@reckart reckart commented Sep 11, 2025

Copy link
Copy Markdown

Set useCaches on single resources obtained directly from the resource loader before returning it from the PathMatchingResourcePatternResolver

Targets main, but should actually go to 6.2.x IMHO.

@reckart reckart force-pushed the bugfix/35464-useCaches-option-in-PathMatchingResourcePatternResolver-not-applied-in-special-case branch from 004303f to 0081ce7 Compare September 11, 2025 15:39
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 11, 2025
@reckart

reckart commented Sep 11, 2025

Copy link
Copy Markdown
Author

Hm, this might actually not build since Resource doesn't seem to expose setUseCaches()... Sorry, I tried using a codespace for this and code completion there seems to be guessing more than knowing.

… loader before returning it from the PathMatchingResourcePatternResolver

Signed-off-by: Richard Eckart de Castilho <richard.eckart@gmail.com>
@reckart reckart force-pushed the bugfix/35464-useCaches-option-in-PathMatchingResourcePatternResolver-not-applied-in-special-case branch from 0081ce7 to b7446de Compare September 11, 2025 15:53
@reckart

reckart commented Sep 11, 2025

Copy link
Copy Markdown
Author

I think this should do it now.

@jhoeller jhoeller self-assigned this Oct 2, 2025
@jhoeller jhoeller added type: bug A general bug in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 2, 2025
@jhoeller jhoeller added this to the 6.2.12 milestone Oct 2, 2025
jhoeller added a commit that referenced this pull request Oct 2, 2025
@jhoeller

jhoeller commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

Good catch!

In terms of addressing this, we can also simply call our local getResource method which does the UrlResource handling on top of ResourceLoader access already. I've resolved this issue with a corresponding commit on 6.2.x.

Thanks for the pull request, in any case!

@jhoeller jhoeller closed this Oct 2, 2025
@github-actions

github-actions Bot commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

Fixed via 3041071

@reckart reckart deleted the bugfix/35464-useCaches-option-in-PathMatchingResourcePatternResolver-not-applied-in-special-case branch October 3, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants