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 request: Can you please add a parameter to clean the cache? #48

Closed
pitsi opened this issue Aug 11, 2020 · 5 comments
Closed

Feature request: Can you please add a parameter to clean the cache? #48

pitsi opened this issue Aug 11, 2020 · 5 comments

Comments

@pitsi
Copy link

pitsi commented Aug 11, 2020

I ran ncdu earlier to check what is using the few GB of my ~ and I came accross this for ~/.cache

 ncdu 1.14.1 ~ Use the arrow keys to navigate, press ? for help                  
--- /home/moi/.cache -----------------------------------------------------------
  603.7 MiB [##########] /fdroidcl                                              
   45.2 MiB [          ] /thunderbird
   12.5 MiB [          ] /mozilla    

and the 600MB of fdroidcl are all from old apks of bromite

ncdu 1.14.1 ~ Use the arrow keys to navigate, press ? for help                  
--- /home/moi/.cache/fdroidcl/apks ---------------------------------------------
                         /..                                                    
  100.6 MiB [##########]  rel_84.0.4147.121_arm64_ChromeModernPublic.apk
  100.6 MiB [######### ]  rel_84.0.4147.90_arm64_ChromeModernPublic.apk 
  100.6 MiB [######### ]  rel_84.0.4147.95_arm64_ChromeModernPublic.apk
  100.6 MiB [######### ]  rel_84.0.4147.119_arm64_ChromeModernPublic.apk
  100.6 MiB [######### ]  rel_84.0.4147.113_arm64_ChromeModernPublic.apk
  100.6 MiB [######### ]  rel_84.0.4147.106_arm64_ChromeModernPublic.apk
    4.0 KiB [          ]  rel_84.0.4147.95_arm64_ChromeModernPublic.apk-etag
    4.0 KiB [          ]  rel_84.0.4147.90_arm64_ChromeModernPublic.apk-etag
    4.0 KiB [          ]  rel_84.0.4147.121_arm64_ChromeModernPublic.apk-etag
    4.0 KiB [          ]  rel_84.0.4147.119_arm64_ChromeModernPublic.apk-etag
    4.0 KiB [          ]  rel_84.0.4147.113_arm64_ChromeModernPublic.apk-etag
    4.0 KiB [          ]  rel_84.0.4147.106_arm64_ChromeModernPublic.apk-etag

How about making a parameter that cleans that cache, like apt's clean and autoclean? Also, I think it is pointless to cache more than one apk from each package, so a "delete everything but the newst one" option would also be useful.

Thank you in advance.

@mvdan
Copy link
Owner

mvdan commented Aug 11, 2020

Yikes, I never thought that hard about caches getting huge in the long run.

I agree that this should happen automatically. I think the simplest way would be to delete files older than, say, 30 or 60 days. If someone wishes to delete things sooner, they can delete the cache via rm. If they wish to use an APK for longer, they should copy it elsewhere, or download it again later. We could use the created time or the "last access" time, I think either would be fine.

Just keeping the latest version of every app also seems OK, but if I install a huge app once and then never install/update it again, that file would remain in the cache virtually forever. So I think making cached files expire after a while is a better general solution.

@C0rn3j
Copy link

C0rn3j commented Jan 11, 2021

Also ended up with a 2GB cache.

I think that ideally a mix of both your suggestions should be implemented - if there is a bigger app that updates somewhat frequently or the user has a lot of apps to install (or both), the cache will be needlessly large.

So by default only keeping latest version and at the same time deleting files older than XX days to not leave things rotting would be good imo.

@pitsi
Copy link
Author

pitsi commented Apr 5, 2021

For the record, I would report @Shawk7529 for spam, but I am sure github will do nothing.
I had reported another user once, whose comment was not spam but completely unrelated to my issue (e.g. "nice idea, would you like to work for me?") and github administration simply ignored it. All I could do is to block the spammy user so that he would not spam any issue I have posted on or started.

I am sorry for the offtopic.

@mvdan
Copy link
Owner

mvdan commented Apr 5, 2021

Thanks @pitsi, hiding, reporting, and blocking.

@Linus789 Linus789 mentioned this issue Jan 9, 2023
Linus789 added a commit that referenced this issue Jan 10, 2023
related issues: #48, #58
@Linus789
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@C0rn3j @mvdan @pitsi @Linus789 and others