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

[Enhancement]: Clean cache feature in Settings #146

Open
Jerry23011 opened this issue May 11, 2023 · 4 comments
Open

[Enhancement]: Clean cache feature in Settings #146

Jerry23011 opened this issue May 11, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@Jerry23011
Copy link

Describe Your Request

Swiftcord generates cache at ~/Library/Containers/io.cryptoalgo.swiftcord. Perhaps a button in Settings to clean it would be great.

Category

Settings

Other Category

No response

Screenshots

截屏2023-05-11 12 38 44
@Jerry23011 Jerry23011 added the enhancement New feature or request label May 11, 2023
@cryptoAlgorithm
Copy link
Member

cryptoAlgorithm commented May 11, 2023

Deleting the whole sandbox container folder (at ~/Library/Containers/io.cryptoalgo.swiftcord) might lead to unexpected consequences (since it stores quite a bit more than caches lol). The bulk of the storage is used by ~/Library/Containers/io.cryptoalgo.swiftcord/Data/Library/Caches, which is probably safe to delete, but I'm not sure if it would lead to inconsistent behaviour if the whole folder is simply deleted. Also, macOS automatically purges these cache folders in a safe fashion when low on storage (another benefit of being a native app), so there is little benefit to deleting them proactively.

The caches mostly store image data (e.g. profile images and server icons), and is limited to 100MB 256MB (so the oldest images will be deleted when the limit is hit), so it is fairly beneficial to simply keep the cache around.

@cryptoAlgorithm
Copy link
Member

cryptoAlgorithm commented May 11, 2023

Also, the cache is crucial to smooth message history scrolling. Without it, reloading every profile image and media every time they scroll into view causes poor performance. And as such, you'll notice that the cache folder quickly grows (capped at 100MB 256MB) after being cleared, especially if many messages are loaded.

@cryptoAlgorithm
Copy link
Member

However since there is interest for such an option (and it doesn't seem too hard to implement), I'll probably implement a "clear image cache" button.

@Jerry23011
Copy link
Author

So there is a limit, I didn't know 😂
I'm just afraid that it'll eventually pile up to several gigabytes, lol

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

No branches or pull requests

2 participants