Registry / devops / netlify-plugin-cache

netlify-plugin-cache

JSON →
library1.0.3jsnpmunverified

A generic Netlify build plugin that caches and restores arbitrary files and directories between builds using Netlify's native cache-utils. Version 1.0.3 is the latest stable release, with no active development. It acts as a thin wrapper around the official cache utility, supporting any static site generator by caching specified paths (defaulting to ['.cache']). Unlike framework-specific cache plugins, this one is intentionally framework-agnostic, allowing users to define custom cache paths for tools like Hugo, Gatsby, Jekyll, Next.js, or any other build tool. The plugin saves cached files after a successful build and restores them before the next build, significantly reducing build times and saving build minutes. No notable release cadence; last updated in 2021.

npm install netlify-plugin-cache
INSTALL
IMPORT
SIG · NETLIFY-PLUGIN-CAC
N
netlify-plugin-cache
devopsjavascriptv1.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

netlify-plugin-cache
// Add to netlify.toml: [[plugins]] package = "netlify-plugin-cache"
npm install netlify-plugin-cache
This is a Netlify build plugin, not a Node.js module. It is configured in netlify.toml, not imported in code.
paths input
[[plugins]] package = "netlify-plugin-cache" [plugins.inputs] paths = ["resources", "_vendor"]
[[plugins]] package = "netlify-plugin-cache" [plugins.inputs] paths = "resources"
paths must be an array, even for a single path. If omitted, defaults to [".cache"].

Minimal netlify.toml configuration to cache two directories between builds.

# netlify.toml [[plugins]] package = "netlify-plugin-cache" [plugins.inputs] # Cache Hugo resources and Gatsby .cache paths = ["resources", ".cache"]
Debug
Known issues
gotchaThe plugin only caches after a successful build. If the build fails, the cache is not updated, and the previous cache is restored on the next run.
fix
Ensure your build script exits with code 0 for caching to work.
affects: >=1.0.0
gotchaPlugin is a wrapper around @netlify/cache-utils, which has its own limitations. Large caches may exceed Netlify's storage limits (default 1GB per site).
fix
Monitor cache size and consider caching only essential directories.
affects: >=1.0.0
deprecatedThe package has not been updated since 2021. Netlify now offers official cache plugins (e.g., @netlify/plugin-cache) that may be better maintained.
fix
Consider switching to @netlify/plugin-cache or framework-specific caching.
affects: >=1.0.0
Errors
Common errors & fixes
Error: In netlify.toml: Plugin netlify-plugin-cache not found
Package name misspelled or not installed via npm/yarn as a dev dependency.
fix
Run 'npm install --save-dev netlify-plugin-cache' or add to package.json dependencies.
Plugin netlify-plugin-cache: input 'paths' must be an array
The paths input is provided as a string instead of an array.
fix
Change to 'paths = ["myfolder"]' in netlify.toml.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
netlify-plugin-cache — npm install netlify-plugin-cache · libregistry