Caching issue - is it possible to modify v= param after updating library eg v=6.2.1

Created on 16 November 2022, about 2 years ago
Updated 26 March 2024, 10 months ago

Problem/Motivation

Is there a way to update the ?v= parameter after updating the library files, to help cache-bust library files in CDN environments? For example: <script src="/libraries/fontawesome/js/fontawesome.min.js?v=6.1.0" defer></script>

I updated /libraries/fontawesome/* over a month ago. No regressions, but icons introduced with the new library are not found (you see only the dotted-line question/exclamation mark) ONLY in the LIVE environment. Dev/Test environments (no caching, no CDN) do not have this problem. I confirmed LIVE Drupal environment has the latest file versions, the deployment succeeded. I have cleared all caches available to me multiple times. NOTE: I do not have access to clear Pantheon's Global CDN cache. In my browser debugger, if I select 'Disable cache', it usually downloads the newer library and the icon will render, but of course that fix is just for me in that one browser. All other users still get the stale file version. All signs point to a CDN-to-browser caching issue. Query params of course are one cache-busting strategy.

Just wondering if there was a way to tweak the 'v=' value anytime a new library is installed?

Steps to reproduce

1. Update /libraries/fontawesome/* to the latest versions downloaded from fontawesome web site
2. Deploy to live environment & clear caches
EXPECTED: new *.js file versions are in effect
ACTUAL: new *.js file versions are in effect in dev/test, but in LIVE, browsers think they have the latest but do not

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Active

Version

2.24

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States en-cc-org

Live updates comments and jobs are added and updated live.
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.

  • πŸ‡³πŸ‡±Netherlands tim_dj Netherlands

    The problem is not just the CSS files. Also font files normally get cached. If you use custom font awesome font kits newer versions will not be loaded so this version parameter should also be included loading the font files itself.

Production build 0.71.5 2024