-
Notifications
You must be signed in to change notification settings - Fork 470
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
How to check the current cache size and delete them #24
Comments
@gameboyVito Hey Regarding getting the cache size, this turned out to be harder then I first thought. I was hoping that using I'm working on a solution that will traverse the cache files and accumulate the size, however it doesn't feel right doing all this work over the RN bridge. Limiting the cache size is a nice concept but I'm afraid implementing it might be a bit of an overhead, for instance, how would handle the case where the cache is "full" and the user tries to cache another image? we would also need to know the cache size at all times, and the sizes of images before we download them. probably manage an LRU or other cache clearing mechanism. Again, suggestions are welcome :) |
Yeah, |
@gameboyVito I would prefer to keep this component simple for now, and avoid dealing with managing the cache size. Thanks for the reference! It would be helpful when we would decide to add cache management. |
@kfiroo Hi, I found this repo has implemented something like lifecycle for cached images. That means when you quit your app and reopen it, all cached images will be deleted when you pass a prop called |
@gameboyVito Oh! I see what you're saying. I was under the impression that Maybe for your profile picture you can simply use an |
Thanks for your patient answer ^_^ |
@gameboyVito Hey, master has a version with a working {
files: [], // an array of all files in the cache represented by their `fs.stat()` result
size: 0 // size of cache in bytes (see example)
} Hope that helps |
genius! thx~ |
How to set the cache size? Tons of images will be cached in the local storage, methods to check the current cache size and delete all cached files, or a prop to set the limit of cache size would be very helpful.
The text was updated successfully, but these errors were encountered: