Cache busts static files and updates their references
This plugin requires Grunt.
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:
npm install grunt-static-cache-buster --save-dev
The "static_cache_buster" task
In your project's Gruntfile, add a section named
static_cache_buster to the data object passed into
An array containing the files whose references will be updated.
<!-- Turn this --><!-- Into this -->
In this example, the source files will be busted by calculating the md5 and appendig it to the name like: 'file-to-bust.js' into 'file-to-bust-79d310bfe9ba9930c28043700467788e.js'.
With filesToUpdateReferences Option
In this example, the sources files will be busted and the refences will be updated.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
v0.1.3 - 2015-10-05
- Reviewed the regex.
v0.1.2 - 2015-10-04
- Reviewed the regex to update the files references.
v0.1.1 - 2015-10-01
- Publish the busting task.
Copyright (c) 2015 valter santos matos. Licensed under the MIT license.
This plugin was inspired by grunt-cache-busting