cache icon indicating copy to clipboard operation
cache copied to clipboard

Documentation for caching package folders

Open StephenCleary opened this issue 6 years ago • 4 comments

The current examples for caching package folders (e.g., npm and nuget) are written in a way that they will cause gradually-increasing cache entry sizes.

Could a note be added to the docs mentioning this? Maybe with a recommended workaround?

StephenCleary avatar Apr 06 '20 13:04 StephenCleary

This issue is stale because it has been open for 365 days with no activity. Leave a comment to avoid closing this issue in 5 days.

github-actions[bot] avatar Dec 23 '21 08:12 github-actions[bot]

I believe this is still an issue.

StephenCleary avatar Dec 28 '21 23:12 StephenCleary

Hi @StephenCleary - Could you help me understand the problem? How is the size gradually-increasing?

pallavx avatar Oct 03 '22 08:10 pallavx

It's because of the restore-keys usage. Consider the nuget example.

If packages.lock.json contains package A, version X, then the first time this is run, there is no cache hit and nothing is restored to the nuget folder. At the end of the run, a cache is created with package A, version X.

Later, package A is upgraded to version Y, with a corresponding change to packages.lock.json. In this case, there is no cache hit but the nuget folder does get package A version X anyway. At the end of the run, an updated cache is created with package A, version X and package A, version Y. Over time (as your package versions change), your cache size grows.

I don't remember what the workaround was. That was years ago now.

StephenCleary avatar Oct 03 '22 14:10 StephenCleary

This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

github-actions[bot] avatar Apr 22 '23 08:04 github-actions[bot]

This issue was closed because it has been inactive for 5 days since being marked as stale.

github-actions[bot] avatar Apr 27 '23 08:04 github-actions[bot]