Closed ardyfeb closed 3 years ago
And how get real key as string from MemoryCache.Key
instance ?
I currently making Coil bridge for React Native, so is not possible pass java / kotlin class to javascript side
It's not possible to get the URL from a MemoryCache.Key
instance. If you need a unique key to pass to Javascript, you could probably use the toString
value of the MemoryCache.Key
.
@colinrtwhite Thanks, i need to make custom key generator on this case
Back to my first question, does new constructed Key
with same real key resolve same cached bitmap?
No, keys created by the image pipeline are different from simple keys created with a String
: https://github.com/coil-kt/coil/blob/master/coil-base/src/main/java/coil/memory/MemoryCache.kt#L63
@colinrtwhite thanks
How to find
MemoryCache.Key
with they real key?On
HttpUriFetcher
,MemoryCache.Key
key is generated based ondata.toString()
that is image url.In case i not hold
MemoryCache.Key
returned fromImageResult
how i can findMemoryCache.Key
instance by they real key (image url).Does
MemoryCache.get(MemoryCache.Key("some-url))
(construct new memory cache key with same real key) will return cached bitmap from previous cached request that load image withsome-url
?