
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
glov-build-cache
Advanced tools
Though glov-build is already highly cached and only reprocesses exactly the files needed to be reprocessed on your machine, some tasks (such as imagemin) are so slow that you do not want to have to run them even once on a new developer's machine, or on a build system (which may be unable to take advantage of a local cache between runs).
This task wrapper is for caching single-input tasks such as image minification or other image postprocessing. Tasks that output multiple outputs (such as a .wav -> .ogg + .mp3 conversion task) are also supported, as long as they are of type gb.SINGLE.
API usage:
const gbcache = require('glov-build-cache');
gb.task({
name: 'name',
input: '*.png',
...gbcache({
key: 'cache-key',
version: 1,
cache_root: './.gbcache',
do_cache_write: false,
do_cache_rebuild: false,
}, {
// actual task definition here
type: gb.SINGLE,
func: doSomething,
},
});
Options
key - required cache keyversion - required cache version - This must be manually incremented when your task's version changes. The automatic hashing of task functions to detect version changes is unstable across Node.js version and platforms, so cannot be used lest the cache be invalid on any installation other than the one that generated it.cache_root - optional root folder for caching, defaults to gb.getSourceRoot()/../.gbcache/do_cache_write optional boolean to enable writing to the cache after every task run, defaults to false unless --cache-write is passed on the command line. This is generally not recommended unless you want developers to always commit and updated cache folder with each commit that changes one of the sources (which has increases the chance of meaningless merge conflicts, etc).do_cache_rebuild optional boolean to enable pruning and rebuilding the cache during the first task run, defaults to false unless --cache-rebuild is passed on the command line. This should be done only periodically when the cache is significantly out of date and needs to be updated and committed to source control.Example usage in build script:
const imagemin = require('glov-build-imagemin');
const imageminOptipng = require('imagemin-optipng');
const gbcache = require('glov-build-cache');
gb.task({
name: 'imagemin',
input: '*.png',
...gbcache({
key: 'imagemin',
version: 1,
}, imagemin({
plugins: [
imageminOptipng(),
],
})),
});
Example occasional workflow to update cache for the rest of your team or build systems, etc:
node build imagemin --cache-rebuild
git add .
git commit -m "update build cache"
FAQs
Git-commit-able caching wrapper for slow build tasks
We found that glov-build-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.