Use library version as query strings for external css (like js does)

Created on 21 May 2019, almost 6 years ago
Updated 18 August 2023, over 1 year ago

Non-aggregated CSS external files do NOT use the library version as a query string like JS library files do. I'm not sure why this is other than it seems like an oversight. Perhaps someone can give good reasoning as to why this was left out of core.

See attached patch for 8.7.1.

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
Asset libraryΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States erscott

Live updates comments and jobs are added and updated live.
  • CSS

    It involves the content or handling of Cascading Style Sheets.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Non aggregated CSS assets use a value from state which is derived from a timestamp and updated on cache clear. There is no need to append a version parameter as far as I can see? Honestly I'm not sure if JS files need it either? Marking PMNMI in case anyone disagrees

  • Status changed to Active over 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom catch

    I think this is valid, but it's a task rather than a bug.

    Using the version instead of the hashed timestamp means that if the CSS version doesn't change, it can persist in CDN/varnish/browser caches even when the Drupal cache is cleared which should result in better hit rates.

    If we have tests for the js version in the query string, we should be able to adapt those for CSS straightforwardly so adding the 'needs tests' tag.

Production build 0.71.5 2024