Giter VIP home page Giter VIP logo

Comments (3)

timbze avatar timbze commented on August 26, 2024 1

I'll use GitHub's cache action as an example. Read up on the feature here.

You do this:

restore-keys: |
  npm-feature-${{ hashFiles('package-lock.json') }}
  npm-feature-
  npm-

Which evaluates to (for example):

restore-keys: |
  npm-feature-d5ea0750
  npm-feature-
  npm-

When npm-feature-d5ea0750 cache is found, it will be restored, but since it's the first key, the cache will not be rebuilt. In effect it means the package-lock.json has not changed and the cache is fine.

When npm-feature- (which is really npm-feature-*) is found, then the cache is restored, but it also will be rebuilt. This would be the case when the package-lock.json file(s) have changed, which means some dependencies have been updated or changed, so then the cache needs to be rebuilt.

from drone-cache.

timbze avatar timbze commented on August 26, 2024

Still needed 😄

Rebuild cache should only run when the primary restore key is not hit. That way I can calculate restore key based on dependencies and it will change only when dependencies change.

from drone-cache.

bdebyl avatar bdebyl commented on August 26, 2024

@timbze Thanks for letting us know. I'd have to know more about the use case to better understand how to implement this. If anyone wants to volunteer for taking this on let me know, otherwise it will probably fairly low priority on the list of Drone Cache related work for me, personally.

from drone-cache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.