Enable contenthash in filename for dynamic assets (#20813) #20932
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport #20813
This should solve the main problem of dynamic assets caches getting stale after a version upgrade. Everything not affected will use querystring-based cache-busting, which includes files loaded via HTML or the worker scripts.
I tested with monaco and the PNG of jquery-minicolors and it's working fine for those.
This is basically a stripped-down version of #18632 which does not go all the way with contenthash in all filenames (as that requires non-trivial backend changes as well), but should be sufficient to solve the immediate issue of stale browser cache after upgrade.
This PR removes the now unused
MD5
template function. Users with custom templates will need to update their templates to stop using this function.