Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] implement reference counting #52

Open
2 tasks
nlf opened this issue Apr 30, 2021 · 1 comment
Open
2 tasks

[FEATURE] implement reference counting #52

nlf opened this issue Apr 30, 2021 · 1 comment
Assignees
Labels
Enhancement new feature or improvement

Comments

@nlf
Copy link
Contributor

nlf commented Apr 30, 2021

What / Why

In order to safely prune old content after storing fresh content in the cache, we need some means of knowing if the old content has now become orphaned. The fastest approach to this is reference counting.

Implementation will require

  • actually implementing reference counting
  • automating migration of old cache stores to deduplicate references and count them
@nlf nlf self-assigned this Apr 30, 2021
@isaacs
Copy link
Contributor

isaacs commented May 2, 2021

We could do the slow migration/pruning step should probably run whenever cacache.verify() is called. The cli runs this as part of npm doctor, but we can also tell the user to do it if cacache doesn't have the ref counting folder.

Also, we need to ensure that cacache still operates properly if ref counts are missing. I'd probably lean towards only updating ref counts if there is one already, and only add them for new items added to the cache, so we don't end up in a situation where it says "references: 1" for something that actually has a bunch of references on it.

@settings settings bot removed the enhancement label Sep 20, 2021
@darcyclarke darcyclarke added the Enhancement new feature or improvement label Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement new feature or improvement
Projects
None yet
Development

No branches or pull requests

3 participants