-
Notifications
You must be signed in to change notification settings - Fork 2
Description
The version: VERSION lines in libraries.yml create a version query string using the Drupal Core version number for the asset files. This causes the files to be cached in the browser and will only invalidate when the core version changes due to the dependency on the version.
When using edge caching or CDN caching this makes it difficult to invalidate the cache if there are changes to these assets and it requires users to manually clear their browser cache to get updated asset files.
By removing the VERSION Drupal will generate a hash id to the file which can be invalidated and new hash IDs generated when the Drupal cache is cleared e.g. drush cr
The string changes on every update or full cache flush, forcing browsers to load a new copy of the files as the URL changed.
See: web/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php:62
Similar to localgovdrupal/localgov_alert_banner#408