I am using Kingfisher on SwiftUI. I download the image from url
with Kingfisher
I will explain the problem step by step:
- I download the image from url
- After I close my own application from the background, I open the Instagram application and scroll down continuously on the main page and I make the Instagram application use the cache.
- Then I turn off the internet and open my own application.
Problem: When I turn off my internet and open my own application again, I cannot get the pictures from the cache. Why ?
.diskCacheAccessExtending(.expirationTime(.never))
and .diskCacheExpiration(.never)
I used these two functions, but the images are still deleted from the cache.
KFImage:
KFImage.url(URL(string: value))
.resizing(referenceSize: CGSize(width: 50, height: 50), mode: .aspectFit)
.diskCacheExpiration(.never) // 1
.diskCacheAccessExtending(.expirationTime(.never)) // 2
.loadDiskFileSynchronously()
.fade(duration: 1)