-
Notifications
You must be signed in to change notification settings - Fork 685
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
Add ImageLoader.clearMemory(key) to clear a single memory cache item #55
Add ImageLoader.clearMemory(key) to clear a single memory cache item #55
Conversation
Thanks for adding this. I want to spend a bit more time thinking about the design for the moment. This is a breaking change to the base |
…/memory-cache-clear-key # Conflicts: # coil-base/src/main/java/coil/memory/MemoryCache.kt
@Javieraeros merge conflicts resolved 👍 |
What do we do with this PR @colinrtwhite ? |
Merge? 😂 |
/** | ||
* Remove a single item from memory cache. | ||
*/ | ||
fun clearMemory(key: String) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this to invalidate
? The behaviour of this function is different enough from clearMemory()
that it should probably have its own name. clearMemory()
empties the bitmap pool as well as the memory cache whereas clearMemory(key)
only removes a specific memory cache entry.
Sorry for the delay on this! @Goddchen left one comment. I'm planning to do a quick |
…che-clear-key # Conflicts: # coil-base/src/main/java/coil/RealImageLoader.kt # coil-base/src/main/java/coil/memory/MemoryCache.kt # coil-base/src/test/java/coil/memory/MemoryCacheTest.kt
Merge branch 'master' of https://github.com/coil-kt/coil into feature/memory-cache-clear-key # Conflicts: # coil-base/src/main/java/coil/memory/MemoryCache.kt
@colinrtwhite merged coil/master, resolved conflicts and renamed the method as requested. I think it can be merged now 👍 |
@Goddchen Awesome! Thanks for the contribution. |
) * Add ImageLoader.clearMemory(key) to clear a single memory cache item * Add test for MemoryCache.clearMemory(key) * Rename clearMemory(key) to invalidate(key) Merge branch 'master' of https://github.com/coil-kt/coil into feature/memory-cache-clear-key # Conflicts: # coil-base/src/main/java/coil/memory/MemoryCache.kt * Update coil-base.api Co-authored-by: Martin Liersch <[email protected]> Co-authored-by: Goddchen <[email protected]>
As discussed/requested by a user on Slack. Being able to clear a single item by its key from memory cache.