Project

General

Profile

Actions

Feature #103356

open

Alternative versioning for static assets

Added by Philipp Wrann 2 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Frontend
Start date:
2024-03-11
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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.

No data to display

Actions

Also available in: Atom PDF