electron / get

Download Electron release artifacts
https://npm.im/@electron/get
MIT License
338 stars 106 forks source link

Expose Functionality to Clear/Delete Versions From Cache #209

Closed dsanders11 closed 2 months ago

dsanders11 commented 2 years ago

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

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 commented 2 years ago

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 commented 2 years ago

@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.

continuous-auth[bot] commented 2 months ago

:tada: This issue has been resolved in version 3.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: