I’m studying tips on how to use Kingfisher’s cache to raised perceive caching mechanisms. I see that Kingfisher makes use of two varieties of cache: MemoryCache
(which makes use of NSCache
) and DiskCache
(which makes use of FileManager
to avoid wasting recordsdata). Each varieties of cache are declared in ImageCache. Nonetheless, I’m a bit confused about how ImageCache works. Particularly, I’ve the next questions:
- Does
ImageCache
in Kingfisher use reminiscence or disk cache by default? Do they use a mixture of each, or simply one of many two? In the event that they use a mixture of each, what’s the mechanism – When the reminiscence cache is full, it would swap to the disk cache? - The 2 varieties of caches (MemoryCache and DiskCache) have the max value property. Is that this property used to restrict the variety of megabytes of photos saved? When the restrict is exceeded, have they got a mechanism to delete pictures?
I’ve learn the Kingfisher supply code, however I’m nonetheless unclear in regards to the default conduct and the mechanism of the ImageCache
when it comes to reminiscence and disk utilization. I might recognize it if somebody may clarify how ImageCache manages its caching technique and the way the max value property features in each MemoryCache and DiskCache.