Giter Club home page Giter Club logo

Comments (3)

onevcat avatar onevcat commented on July 22, 2024

I am not quite sure about your use case and image updating mechanism, to me, it is not quite a perfect case to use Kingfisher. If you just need to refresh the image every time, you can use the forceRefresh to ask Kingfisher loads from your url instead of seeking it from the cache.

Behind the story, when you are using KFImage(url) to display an image, it in fact tries to download it from the url and caches it with the combination of the cacheKey (by default, the URL string) and the processors identifier. That is because we just want to store the final result instead of the medium artifacts. However, in your code (setImage(_:_:), you are trying to check and cache the image again with the cacheKey alone. With any processors (here resizing and downsampling), the actually used cache key in this method does not equal to the one used by KFImage(url). That means, you are indeed clearing the image and caching it again, but under a different key that KFImage(url).resizing. downsampling is not using.

After each image creation, I will use Kingfisher to save it to the device's cache (I don't know if this is safe for data or not because I'm just a novice with Swift and Kingfisher).

If the images are important, I have to say it is not a good idea. These content are user created and cannot be restored. As the ImageCache's name suggests, it is possible that these cached images being purged (due to system behavior, disk space not enough, normally expires, etc). That is also a reason I said "it is not quite a perfect case to use Kingfisher" at the beginning.

from kingfisher.

baronha avatar baronha commented on July 22, 2024

So in my case, would it be reasonable to save the image in FileManager and use KingFisher to display the image via the local url?
Based on your experience, please give me a solution. Please!

from kingfisher.

baronha avatar baronha commented on July 22, 2024

@onevcat Can you solve this problem?

from kingfisher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.