Giter Club home page Giter Club logo

android-image-cache's People

Contributors

eschlenz avatar xxv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-image-cache's Issues

add sanity checks for resizing input

Instead of attempting to resize a huge image and causing an OOM error, the library should check to see if it's a reasonable size to scale and go from there.

The idea of a "reasonable size" should be determined empirically based on actual memory consumption for resizing an image using the resize technique used in the library.

It's also possible that resizing a huge image is fairly efficient and that this sanity check is unnecessary.

properly cleanup cache

At the moment, the image cache doesn't actually do any cleanup of its cache. This should be fixed, perhaps with some state persistence using file access times or something like that.

add negative cache timeout

If an image URL resolves to a 404, it shouldn't pound on the server trying to download it. Instead, it should have a sane timeout for when it should retry.

This can possibly be done using the LastUpdatedMap in MelAUtils.

improve memory management

At the moment, the image cache doesn't do a good job handling out-of-memory conditions. It occasionally causes an Activity to crash due to memory consumption.

Some tests should be created and memory usage should be profiled to see where it can best be optimized.

Add positive cache timeout

So that images that get cached are updated, standard HTTP caching techniques should be employed to ensure that they aren't out of date.

This includes conditional HTTP headers, e-tag storing and last-modified storing. The metadata should be stored in a way that hitting the "clear cache" button in the system UI will clear the database too.

It may even make sense to look into using a proper HTTP caching library for this part, while still using this for any resized derivatives. This library will still need to know when to refresh derivatives, so it may need to communicate with the cache.

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.