npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nuxt-netlify-cache

v1.0.2

Published

Nuxt.js module that uses netlify cache to speed up redeploy

Downloads

53

Readme

Nuxt netlify cache

Nuxt.js module that helps to speed up Netlify content updates by 20%-80%.

Strategies

This package can be used in two ways: Module and Advanced. But generally, the flow looks like this:

  1. Save .nuxt dir to netlify cache dir on a redeploy.
  2. Detect a redeploy that has been triggered with a HTTP-request using netlify hook.
  3. If this request has a special flag inside, restore .nuxt dir from cache and try to use it to speed up the process.

Module usage

This is a simplified approach, but not the fastest one. It uses webpack-cache feature to speed up bundle build process.

  • Add nuxt-netlify-cache dependency
  • Define nuxt module:
{
  modules: [
   'nuxt-netlify-cache'
  ]
}
  • Make sure your generate script includes build command: nuxt build && nuxt export
  • Add a special flag use_cache (flag value changeable with module options) to your netlify-hook like this: https://api.netlify.com/build_hooks/XXXXXXXXXXXXXXX?trigger_title=Your+title+use_cache
  • Add updated netlify-hook URL to your CMS and check netlify deploy-logs to make sure netlify-cache kicked in

Advanced usage

This is a more complicated approach that removes bundle-build process entirely. It saves cache the same way as it does in the module approach, but this time if it detects use_cache flag in redeploy request, it runs nuxt export instead of nuxt build && nuxt export.

  • Add nuxt-netlify-cache dependency
  • Add a new command to package.json
"scripts": {
  "generate:cached": "nuxt-netlify-cache",
  • Cange your Netlify Build Command to npm run generate:cached
  • Add a special flag use_cache to your netlify-hook as follows: https://api.netlify.com/build_hooks/XXXXXXXXXXXXXXX?trigger_title=Your+title+use_cache
  • Check netlify deploy-logs to make sure netlify-cache kicked in

Old Nuxt < v2.13

nuxt generate has been renamed to nuxt export in Nuxt.js version >= v2.13. If you are still using old version, you need to use version v0.0.3 of this package.