Skip to content

Remove VERSION from libraries.yml #106

@millnut

Description

@millnut

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions