Bust your asset cache using querystring hashes based on actual asset content
npm install asset-cache-bust and tags that contain a href or src
data-finger-print attribute. It then extracts the URL from those attributes and
v=md5stringGoesHere. When all matched URLs have been replaced in
or tags in the following format for this package to
or .
npm install asset-cache-bust
const assetCacheBust = require('asset-cache-bust');
assetCacheBust(validHtml)
.fork(
error => console.log(error), // Do something usefull with the error
cacheBustedHtml => console.log(cacheBustedHtml) // Do something with the cache busted HTML
);
`
To use the CLI you have 2 options:
* Install this package globally:
1. Install this module using npm install -g asset-cache-bust
2. Cache bust html files using asset-cache-bust *.html for example
> type asset-cache-bust --help for help and options
* Install this package locally:
1. Install this module using npm install asset-cache-bust
2. Create an npm script in your package.json file with a fitting name and corresponding value.
e.g. "bust-cache": "asset-cache-bust *.html"
3. Run your npm script using npm run