#103356Alternative versioning for static assets
Description
Hi! I would really like to increase the usage of the asset collector but i have 1 issue with it:
The version number created for the assets is based on the modification time of the file. This might be reasonable in classic development setups but IMO it is not optimal in continous delivery deployments, where you either exchange whole containers for running applications or make a new release and switch a symlink. The modification time will always change no matter if something in the file contents changed or not. I do not want to compromise returning visitor browser caches by returning new version numbers after every deployment.
Therefore i tend to NOT use the asset collector at all in favor of my own implementations, which will add the md5-hash of the target file. I would like to remove the custom implementations in favor of the official API (AssetCollector).
So my feature request:
Can you provide an option to configure the behaviour of the version number generation?
I suggest 2 possible options (mtime[default], md5) alongside a PSR-14 Event for custom solutions.
Reviews 1
History 12
-
Benni Mack commented and changed status
NewAccepted <span data-processor="relativetime" data-value="2025-04-09T17:03:03+00:00" > 04/09/25, 17:03 </span> -
Gerrit Code Review pushed patch set 1 for main to change 97627 status
AcceptedUnder Review <span data-processor="relativetime" data-value="2026-11-13T19:06:23+00:00" > 11/13/26, 19:06 </span>
Yes. we will provide something like this, but first we need to rework so many quirks in this code base… but the use-case is completely valid.