Giter Site home page Giter Site logo

Comments (2)

deepanshushuklad11 avatar deepanshushuklad11 commented on August 24, 2024

@msbit @cortinico I did a bit of debugging .
In android we are using Fresco for images, after fetching image from Disk it caches it in memory .
So even if you delete the file from disk it will be served direct from bitMapMemoryCache.
We can test it adding this in ReactImageView.java

     Fresco.getImagePipeline().evictFromMemoryCache(mImageSource.getUri()); // mImageSource.getUri() is the image url
     Fresco.getImagePipeline().evictFromDiskCache(mImageSource.getUri());

I propose we should provide a method like Image.deleteCache([uri])
So that user can control what need to be served from disk or cache
Let me know your thoughts, i am happy to raise a PR for the same.

from react-native.

cortinico avatar cortinico commented on August 24, 2024

Thanks for the investigation @deepanshushuklad11

     Fresco.getImagePipeline().evictFromMemoryCache(mImageSource.getUri()); // mImageSource.getUri() is the image url
     Fresco.getImagePipeline().evictFromDiskCache(mImageSource.getUri());

The user can just invoke these methods instead if they need to evict the cache. We don't need an API on React Native to do so (hence I'm closing this).

I would argue that you should instead opne a issue against facebook/fresco to ignore caching for file://* URIs.

from react-native.

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.