spring-projects / spring-projects/spring-framework

Cache busting issue when configured ContentVersionStrategy + CssLinkResourceTransformer

Open
#26,382 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: web status: pending-design-work type: enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.