Giter Club home page Giter Club logo

Comments (2)

ElrB avatar ElrB commented on July 22, 2024

@onevcat please assist. Thanks.

from kingfisher.

onevcat avatar onevcat commented on July 22, 2024

@ElrB Sorry for the late reply.

I don't think there is a "certain duration that LocalFileImageDataProvider works"...Regardless of a local data provider or a remote URL data fetching, both are working in similar ways: Check the cache, if not hit, then get the data from the origin place (the local file or URL) and cache the image.

From your description, it seems that once the cache is expired, it stops loading from the original local file. It should not happen.

I also tried to build a simple sample with LocalFileImageDataProvider and a very short disk cache expiration duration (to simulate your case), but I cannot reproduce it at all.

Can you try:

  1. Make sure that the url you use in fetchStoredImage has exactly the same path as you get in isImageSaved.
  2. Try to print some result to see if there is an error and/or where the image is from when you set it.
self.imageView.kf.setImage(with: provider, options: self.options) { result in
  switch result {
    case .success(let r):
      print(r.cacheType)
      print(r.source)
    case .failure(let error):
      print(error)
  }
}

By the way, you can use the .diskCacheExpiration option change the disk cache duration to a smaller value to boost the verification.

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.