Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
netlify-plugin-cache
Advanced tools
Generic cache plugin for saving and restoring files and/or folders between Netlify builds
A generic cache plugin for saving and restoring files and/or folders between Netlify builds for impressive speed improvements. Worry less about running out of build minutes! ⏰
Essentially, this plugin is a pretty wrapper around Netlify's native cache utility — it isn't tied to any specific static site generator (on purpose).
Add the following lines to your netlify.toml
:
[[plugins]]
package = "netlify-plugin-cache"
[plugins.inputs]
# Optional (but highly recommended). Defaults to [".cache"].
paths = ["resources", "_vendor", "folder/file.md"]
This plugin only takes one input named paths
: an array of files and/or directories relative to your project's root. These files/directories are restored before a build and saved in cache after a build if it is successful.
🚨 Important: paths
defaults to [".cache"]
, but it's highly recommended you set this yourself based on the tool(s) you're using to generate your site. See examples below.
Read more about plugin configuration at the official Netlify Plugin docs.
resources
directory can speed up your build greatly if you process a lot of images, or compile SASS/SCSS via Hugo pipes. You can also cache the public
directory to avoid completely rebuilding the entire site on each deploy. More info here..cache
directory holds persistent data between builds. You can also cache the dist
directory to avoid completely rebuilding the entire site on each deploy. More info here..jekyll-cache
directory. More info here..next
directory holds the build output. More info here.This plugin doesn't provide a way to output a list of files that were cached or restored, because Netlify already provides an official plugin named netlify-plugin-debug-cache
to do exactly that. No need to re-invent the wheel!
You can add the debug plugin after this plugin in your netlify.toml
. (And yes, you need a [[plugins]]
line for each plugin you add.)
[[plugins]]
package = "netlify-plugin-debug-cache"
The debug plugin will generate a file named cache-output.json
at the root of your project's publish directory. See an example file or learn more about this plugin.
This project is distributed under the MIT license.
FAQs
Generic cache plugin for saving and restoring files and/or folders between Netlify builds
The npm package netlify-plugin-cache receives a total of 3,633 weekly downloads. As such, netlify-plugin-cache popularity was classified as popular.
We found that netlify-plugin-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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.