I am using Kingfisher library for the purpose of caching images in UICollectionView cells.
I noticed that calling kf_setImage
(assuming that the name of the cell called listCell
and its ImageView called imgMain
) as follows:
listCell.imgMain.kf.setImage(with: URL(string: "MY IMAGE URL"),
placeholder: UIImage(named: "PLACEHOLDER IMAGE"))
works fine, it does caches the image and display it when cell has been re-dequeued (when scrolling up and down, I can see the image directly without re-downloading it), but when I pull to refresh the collection view (recall the API with the same exact parameters, which means that it will return the same image urls) the images have been re-downloaded! I assume that the images already have been cached.
To make it more clear, this link contains gif image that describes what am I facing.
So, why the images get downloaded once again? is it the default behavior of the caching in Kingfisher? Is there any configuration that should edited to behave as I expect?
I read the library documentation, but -unfortunately- I couldn't find and useful information related to what am I asking for.