All Projects → jakejarvis → netlify-plugin-cache

jakejarvis / netlify-plugin-cache

Licence: MIT license
⚡ Generic plugin for caching any files and/or folders between Netlify builds

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to netlify-plugin-cache

build-plugin-template
Template repository to create new Netlify Build plugins.
Stars: ✭ 26 (+36.84%)
Mutual labels:  build, ci, netlify
Build
Netlify Build runs the build command, Build Plugins and bundles Netlify Functions.
Stars: ✭ 135 (+610.53%)
Mutual labels:  build, ci, netlify
Flutter engine build
Flutter Engine构建产物归档
Stars: ✭ 19 (+0%)
Mutual labels:  build, ci
Backfill
A JavaScript caching library for reducing build time
Stars: ✭ 50 (+163.16%)
Mutual labels:  build, cache
Buildbuddy
BuildBuddy is an open source Bazel build event viewer, result store, and remote cache.
Stars: ✭ 182 (+857.89%)
Mutual labels:  build, cache
Baur
baur manages builds and artifacts in mono repositories
Stars: ✭ 285 (+1400%)
Mutual labels:  build, ci
Unity Actions
Github actions for testing and building Unity projects
Stars: ✭ 358 (+1784.21%)
Mutual labels:  build, ci
Github Build
Github builds for CI
Stars: ✭ 133 (+600%)
Mutual labels:  build, ci
makes
A DevSecOps framework powered by Nix.
Stars: ✭ 158 (+731.58%)
Mutual labels:  build, ci
netlify-plugin-image-optim
Optimize images as part of your Netlify build process. Optimizes PNG, JPEG, GIF and SVG file formats.
Stars: ✭ 63 (+231.58%)
Mutual labels:  netlify, netlify-plugin
netlify-cache-nextjs
Cache the Next.js build folder in your Netlify builds
Stars: ✭ 60 (+215.79%)
Mutual labels:  netlify, netlify-plugin
unity-test-runner
Run tests for any Unity project
Stars: ✭ 134 (+605.26%)
Mutual labels:  build, ci
Unity Builder
Build Unity projects for different platforms
Stars: ✭ 258 (+1257.89%)
Mutual labels:  build, ci
build-status
Emacs minor mode that monitors and shows a buffer's build status in the mode line.
Stars: ✭ 26 (+36.84%)
Mutual labels:  build, ci
Androidsdk
🐳 Full-fledged Android SDK Docker Image
Stars: ✭ 776 (+3984.21%)
Mutual labels:  build, ci
calendar-view-plugin
Jenkins Calendar View Plugin: Shows past and future builds in a calendar view
Stars: ✭ 17 (-10.53%)
Mutual labels:  build, ci
Action Docker Layer Caching
🐳 Enable Docker layer caching in GitHub Actions
Stars: ✭ 160 (+742.11%)
Mutual labels:  ci, cache
drevops
💧 + 🐳 + ✓✓✓ + 🤖 + ❤️ Build, Test, Deploy scripts for Drupal using Docker and CI/CD
Stars: ✭ 55 (+189.47%)
Mutual labels:  build, ci
Mbt
The most flexible build tool for monorepo
Stars: ✭ 184 (+868.42%)
Mutual labels:  build, ci
micromamba-docker
Rapid builds of small Conda-based containers using micromamba.
Stars: ✭ 97 (+410.53%)
Mutual labels:  build, ci

Netlify Plugin: Custom Cache npm CI

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).

💿 Install

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.

👩‍💻 Usage

  • Hugo: Caching the 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.
  • Gatsby: By default, the .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: A caching API was added as of v4. The notoriously slow SSG can become (relatively) faster by caching the .jekyll-cache directory. More info here.
  • Next.js: The .next directory holds the build output. More info here.
  • Anything else: This is the reason I kept this plugin as generic as possible! Research the caching behavior of your static site generator (and how to customize it if necessary). Feel free to open a PR and list it here as well!

🐛 Debugging

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.

📜 License

This project is distributed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].