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

Expose Functionality to Clear/Delete Versions From Cache #209

Closed
dsanders11 opened this issue Nov 24, 2021 · 3 comments · Fixed by #267
Closed

Expose Functionality to Clear/Delete Versions From Cache #209

dsanders11 opened this issue Nov 24, 2021 · 3 comments · Fixed by #267
Labels
released ✨ enhancement New feature or request

Comments

@dsanders11
Copy link
Member

Would be useful if this library exposed functions which could be used to:

  • Clear the entire cache
  • Delete specific versions from the cache

Since Electron Fiddle uses this project to download versions, the delete functionality in Fiddle only deletes some of what's downloaded to disk, since the cache here in the get project lives on.

So ideally this project would expose a function that Fiddle could use to delete a cached version from disk so that delete in Fiddle truly means delete, instead of leaving gigs of cached versions behind. For someone with limited disk space (500 GB), this is a noticeable pain point.

@MarshallOfSound
Copy link
Member

I think it would be better if get just allowed fiddle to say "bypassCache: true". Exposing cache related API surface doesn't sound fun as we mess with cache related things all the time. Just saying "plz no cache I'll do it myself" seems more reasonable

@dsanders11
Copy link
Member Author

dsanders11 commented Nov 24, 2021

@MarshallOfSound, fair point. I was just thinking clear/delete wouldn't get too far into the weeds, but you're right, any new API surface is a new maintenance burden.

Just my 2 cents, but maybe noCache or dontCache or dontCacheArtifact could work as the option name, bypassCache could be confusingly close to force since force "bypasses" the cache and downloads the file again, but still caches the result.

EDIT: And the options could dovetail together then a bit, where dontCacheArtifact: true could still read an existing cached version if it exists (to take advantage of it being cached from some other usage of get), but wouldn't save to the cache, and adding in force: true would let you always re-download and not add it to the cache.

EDIT 2: Or to align with the HTTP cache headers, noStore.

@dsanders11 dsanders11 added the ✨ enhancement New feature or request label Aug 3, 2023
Copy link

🎉 This issue has been resolved in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released ✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants