Bust static assets from the cache using date.now(). Can also filter a specific file to be cache busted.
npm install grunt-bust-cache-variable> Bust static assets from the cache using date.now() along with the ability to target specific files.

This plugin requires Grunt ~0.4.2
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
``shell`
npm install grunt-bust-cache-variable --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js`
grunt.loadNpmTasks('grunt-bust-cache-variable');
If the plugin has been installed correctly, running grunt --help at the command line should list the newly-installed plugin's task or tasks. In addition, the plugin should be listed in package.json as a devDependency, which ensures that it will be installed whenever the npm install command is run.
[grunt]: http://gruntjs.com/
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md
[package.json]: https://npmjs.org/doc/json.html
Use the bustMyCache task for cache busting static files in your application. This allows them to be cached forever by the browser, just point the task towards any file that contains references to static assets.
_Currently supported static assets: CSS & JavaScript.
_Note:_ Remote URLs for CSS and JavaScript are ignored by bustMyCache. This assumes that remote URLs for these assets will
be CDN hosted content, typically for well known libraries like jQuery or Bootstrap. These URLs typically include a version
identifier in the URL to deal with browser caching, and it is in the best interest of your app to use the standard URL as-is
to ensure browser cache hits for popular libraries. For example, all of below URLs will be ignored:
`html
`
to the data object passed into grunt.initConfig().`js
bustCacheVariable: {
default: {
options: {
filter: 'base'
},
files: {
'src/pageHeader.jsp':'dist/pageHeader.jsp'
}
}
}
`$3
#### options.filter
Type:
String
Default value: falseAllow you to pass a path to a specific variable to be cache busted, useful if you don't want to blow away the cache on all of your files.
#### options.baseDir
Type:
String
Default value: ./If your assets are located in a different directory, make sure you set this to the correct base path.
$3
#### Basic Asset Cache Busting
`js
grunt.initConfig({
bustCacheVariable: {
default: {
files: {
'src/pageHeader.jsp':'dist/pageHeader.jsp'
}
}
}
})
`#### Basic Asset Cache Busting with different configs
`js
grunt.initConfig({
bustCacheVariable: {
global_css: {
options: {
filter: 'global_css'
},
files: {
'src/pageHeader.jsp':'dist/pageHeader.jsp'
}
},
product_css: {
options: {
filter: 'product_css'
},
files: {
'src/pageHeader.jsp':'dist/pageHeader.jsp'
}
}
},
})
``