Grunt plugin that appends timestamps or MD5 hashes to asset URLs in HTML files to bust browser caches. Current stable version is 2.0.1, last updated in 2015. It modifies references to JavaScript, CSS, or other static files by adding query strings, filename-based versioning, or hash-based replacements. Differentiators: supports multiple hash strategies (timestamp, MD5 of file contents), multiple file matching per task, and flexible URL position (query string, filename, overwrite). Works with Grunt ~0.4.1. Note: This is a legacy Grunt plugin; consider modern build tools (e.g., webpack, Vite) for cache busting.
npm install grunt-cache-breakerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure grunt-cache-breaker to append timestamps to matched asset URLs in an HTML file.
Migrate to webpack, Vite, or other current bundlers with integrated cache busting (e.g., content hashes in filenames).
Use array of objects like: match: [{ 'script.js': 'path/to/script.js' }, { 'style.css': 'path/to/style.css' }]Set options.replacement: 'md5' in your task config.
Test with your Grunt version; consider pinning Grunt to ~0.4.5 if using this plugin.
Add grunt.loadNpmTasks('grunt-cache-breaker'); to the Gruntfile.Verify the file path relative to the Gruntfile. Use a glob pattern or absolute path if needed.
Ensure options contains a match array with at least one string pattern. Example: options: { match: ['*.js'] }.