{"id":45054,"library":"grunt-cache-busting","title":"grunt-cache-busting","description":"A Grunt 0.4 plugin for cache busting static files by renaming files with a content hash and updating references in HTML. Version 0.0.11 is the latest and appears stable though rarely updated. It differs from alternatives like grunt-cache-bust by supporting both filename-embedded hashes and query string parameters, and it also cleans up old hashed files. It requires Grunt ~0.4.0 as a peer dependency and operates in a Node environment >= 0.8.0.","status":"maintenance","version":"0.0.11","language":"javascript","source_language":"en","source_url":"git://github.com/PaulTondeur/grunt-cache-busting","tags":["javascript","grunt","cache","buster","busting"],"install":[{"cmd":"npm install grunt-cache-busting","lang":"bash","label":"npm"},{"cmd":"yarn add grunt-cache-busting","lang":"bash","label":"yarn"},{"cmd":"pnpm add grunt-cache-busting","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"required peer dependency, version ~0.4.0","package":"grunt","optional":false}],"imports":[{"note":"Grunt plugins are loaded via loadNpmTasks, not directly required. The task is then configured in the Gruntfile under the 'cache-busting' key.","wrong":"require('grunt-cache-busting');","symbol":"grunt-cache-busting task","correct":"grunt.loadNpmTasks('grunt-cache-busting');"},{"note":"The task name uses a hyphen, not underscore. The configuration key must be quoted if it contains a hyphen, or accessed via bracket notation.","wrong":"grunt.initConfig({ cache_busting: {} });","symbol":"cache-busting task configuration","correct":"grunt.initConfig({ 'cache-busting': { /* target options */ } });"},{"note":"When registering tasks, use the hyphenated name 'cache-busting', not underscore.","wrong":"grunt.registerTask('default', ['cache_busting']);","symbol":"grunt task alias","correct":"grunt.registerTask('default', ['cache-busting']);"}],"quickstart":{"code":"// Gruntfile.js\nmodule.exports = function(grunt) {\n  grunt.loadNpmTasks('grunt-cache-busting');\n\n  grunt.initConfig({\n    'cache-busting': {\n      css: {\n        replace: ['tmp/**/*.html'],\n        replacement: 'style.css',\n        file: 'tmp/deploy/css/style.css',\n        cleanup: true\n      }\n    }\n  });\n\n  grunt.registerTask('default', ['cache-busting']);\n};","lang":"javascript","description":"Minimal Gruntfile configuring the cache-busting task for CSS files. The task renames style.css to include a content hash, updates all HTML references, and cleans up old hashed files."},"warnings":[{"fix":"Consider migrating to a modern alternative such as gulp-cache-bust or webpack's content hash.","message":"grunt-cache-busting is no longer under active development. Last release was in 2015 and remains compatible only with Grunt 0.4.","severity":"deprecated","affected_versions":"0.0.11"},{"fix":"Ensure replacement includes the full filename with extension (e.g., 'style.css'). For requirejs, provide the base name without extension (e.g., 'MainApp').","message":"The 'replacement' string must exactly match the reference in the replaced files, including extension. If the extension is omitted, the hash will be appended directly without extension preservation.","severity":"gotcha","affected_versions":"*"},{"fix":"Verify that the file path in 'file' is correct and that the file exists before running the task.","message":"The 'file' option points to the original file that will be renamed. The task will fail if the file does not exist or if the directory is not writable.","severity":"gotcha","affected_versions":"*"},{"fix":"For reliable cache busting, omit get_param or set it to false, so the filename is changed.","message":"Using 'get_param: true' appends a query string ?v=HASH. Some proxy servers will not cache-bust on query string changes; consider using filename hashing instead.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.0.11':27 '0.4':7 '0.4.0':68 '0.8.0':79 'also':59 'altern':40 'appear':32 'bust':4,11,45,84 'buster':83 'cach':3,10,44,82 'clean':60 'content':19 'depend':72 'differ':38 'embed':51 'environ':78 'file':13,16,64 'filenam':50 'filename-embed':49 'grunt':2,6,43,67,81 'grunt-cache-bust':1,42 'hash':20,52,63 'html':25 'javascript':80 'latest':30 'like':41 'node':77 'old':62 'oper':74 'paramet':56 'peer':71 'plugin':8 'queri':54 'rare':35 'refer':23 'renam':15 'requir':66 'stabl':33 'static':12 'string':55 'support':47 'though':34 'updat':22,36 'version':26","created_at":"2026-06-07T12:53:08.072881+00:00","updated_at":"2026-06-07T12:53:08.072881+00:00","problems":[{"fix":"Run 'npm install grunt-cache-busting --save-dev' and add 'grunt.loadNpmTasks('grunt-cache-busting');' to your Gruntfile.","cause":"The grunt-cache-busting plugin is not installed or not loaded in Gruntfile.","error":"Warning: Task \"cache-busting\" not found. Use --force to continue."},{"fix":"Check that the file path is correct and the file exists before running the task.","cause":"The file specified in the 'file' option does not exist.","error":"Fatal error: Unable to read file \"path/to/file\" (Error code: ENOENT)."},{"fix":"Add a 'replacement' string to your cache-busting target, e.g., replacement: 'style.css'.","cause":"The 'replacement' option is missing from the task configuration.","error":"ReferenceError: Replace option 'replacement' not defined."},{"fix":"Add a 'file' string pointing to the file to be hashed, e.g., file: 'dist/css/style.css'.","cause":"The 'file' option is missing from the task configuration.","error":"ReferenceError: Replace option 'file' not defined."},{"fix":"Ensure 'replace' is an array of glob patterns, e.g., replace: ['src/**/*.html'].","cause":"The 'replace' option is not set or is an invalid type.","error":"Warning: Path must be a string. Received undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/PaulTondeur/grunt-cache-busting","github":"git://github.com/PaulTondeur/grunt-cache-busting","docs":null,"changelog":null,"pypi":null,"npm":"grunt-cache-busting","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}