Gulp Hash

screenshot of Gulp Hash

A gulp plugin for cachebusting files by adding a hash to their name and/or content.

Overview

Gulp-hash is a powerful tool designed for cache-busting your assets by appending a unique hash to your file names. This is especially crucial for web development, where browsers can cache files, leading to users not seeing the latest updates. With gulp-hash, developers can ensure that their assets are always fresh by generating a new version whenever changes are made, effectively avoiding the pitfalls of caching.

This plugin not only enhances your workflow by managing asset versions but also creates a manifest file, mapping original filenames to their hashed counterparts. The use of customizable options makes it flexible to fit various project requirements, allowing developers to optimize their build processes seamlessly.

Features

  • Manifest Generation: Creates a JSON manifest file that maps original filenames to the newly hashed versions, enabling seamless tracking of asset changes.

  • Custom Hashing Algorithms: Supports customization of hashing algorithms (default is SHA-1) to tailor the security and uniqueness of file names as per project standards.

  • Adjustable Hash Length: Allows specification of the hash length added to the file name, providing control over how distinct the files will appear.

  • Template Customization: Users can customize the naming convention using a template, allowing for flexibility in how hashed file names are formatted.

  • Version Control: Incorporates a version option that enables developers to regenerate hashes without modifying file content, facilitating better version management.

  • Streaming and Buffer Support: Works seamlessly with both streams and buffers, ensuring compatibility with a variety of workflows.

  • Options for Managing Old Files: Offers features to delete old files automatically and manage existing manifests, streamlining the asset management process.

  • Community Support: Active GitHub repository allows for community submissions and problem-solving, ensuring ongoing improvements and assistance.

gulp
Gulp

Gulp.js is an old but popular site building tool that automates various repetitive development tasks in web development, such as compiling Sass, minifying JavaScript, and optimizing images.