This project is not covered by Drupal’s security advisory policy.
Description
This module adds cache buster '?v=' parameters to your custom javascript files. By default, Drupal adds 'version' parameter of your custom JS library to the request string. However, this is not convenient as you need to bump library version every time you make a tiny change.
If you don't do that, users may be served and obsolete version of the JS file (especially if your website uses CDN).
When you need this module
Usually such a problem does not happen due to JS aggregation, which provides a new filename for the generated JS bundle. But sometimes, you may need to disable aggregation, or you want a specific JS library to be loaded separately (for performance or other reasons).
In that case, this module can help you to resolve cache issues.
Usage
You can use it in the library declaration section, by adding 'enable_buster: true' parameter:
global-scripts:
version: 1.0
js:
js/header_js_not_aggregated.js: {scope: header, enable_buster: true}
Or in the twig template:
<script src="{{ cache_buster('/path/to/js/critical.js') }}"></script>
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Developer tools
16 sites report using this module
- Created by anrkaid on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.