Caching brew?



is it possible to cache brew ? 2 years ago was not possible: How do I cache brew install node?


What folders do you want to cache? Brew’s internal package folders, or system binary/library install folders? How long does Brew take to do what you’re asking it to do (presumably install binaries)?


not sure which are the best folders to cache. I do

brew upgrade node
brew install gradle
brew install ruby

which takes 2m 30seconds


Perhaps the best course of action is to ask a general question (e.g. on a Brew support channel or Stack Overflow) asking what folders this software will write to. Assuming it is a package/dependency manager, it might write to your project folder, a system folder, or your home folder. Find that out, and you’ll know what stuff to cache.

If your installs take 2:30 then caching might be helpful, but only if the cached data is faster to transfer than your download time. If the above packages are, say, 100M, then you should be OK, but if they’re 800M, maybe not.

I wonder if a custom Docker image would be better anyway? Create a separate build for this, choose a suitable base image, add what you want, push it to a registry, and then pull when you need it.


found it: /usr/local/Homebrew restore takes 10 seconds and brew updates just 30 seconds. Mutch better than 2 minutes 30 seconds.


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.