This is a follow-up to #35218
It seems the PR fixing the issue above missed a special case:
https://github.com/spring-projects/spring-framework/blob/main/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java#L393-L396
It looks like here a resource is obtained from the resourceLoader, but the useCaches option is not set on it.