Docker and CI/CD · Middle · Question 32 of 75

What makes a good cache key for node_modules or the npm cache in CI?

Explanation

hashFiles('**/package-lock.json') changes only when dependencies change. A commit SHA would never hit; restore-keys can fall back to a partial match.

Further reading

Problem with a question

Docker and CI/CD · Middle · question 32

Test yourself

Take the Docker and CI/CD · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz