spring-projects / spring-projects/spring-framework
ResourceUrlEncodingFilter cache misses are expensive
@bclozel is already working on this.
Since Nov 19, 2025.
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
A PetClinic user noticed this (https://github.com/spring-projects/spring-petclinic/issues/1732). For me it's a 2x throughput degradation on the home page of PetClinic, for the user that reported the issue it was 4x. The problem seems to be that ResourceUrlEncodingFilter has a CachingResourceResolver in it that works great for actual classpath resources. Conversely, links that are not static resources are cache misses, and they have to be checked every time in case they are, after all, on the classpath (e.g. links to other pages in the app).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.