spring-projects / spring-projects/spring-framework
Cache busting issue when configured ContentVersionStrategy + CssLinkResourceTransformer
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
When configuring ContentVersionStrategy we are experiencing a problem when a resource referenced in a css file is modified (url with md5 hash changed) but the css file itself remains exactly the same (same md5 hash).
We are not getting the last version as the application is rewritting the resource with the same hash (i.e: style-8736f7fc00b943645acfcde4d1456233.css) but the actual content is different (different hashes in the rewritten urls inside de css file).
Are we doing something wrong?
Is there a way to compute de md5 hash (ContentVersionStrategy) after content of the css has been transformed by the CssLinkResourceTransformer?
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.
Research direction
Start by tracing how ContentVersionStrategy calculates the CSS resource version relative to CssLinkResourceTransformer's rewritten URLs. Reproduce the case where a referenced resource changes while the CSS source does not, then verify that the served CSS receives a version reflecting its transformed content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100