Skip to content

Conversation

reckart
Copy link

@reckart reckart commented Sep 11, 2025

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
Copy link
Author

reckart commented Sep 11, 2025

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 <[email protected]>
@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
Copy link
Author

reckart commented Sep 11, 2025

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
Copy link
Contributor

jhoeller commented Oct 2, 2025

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
Copy link
Contributor

github-actions bot commented Oct 2, 2025

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