GithubHelp home page GithubHelp logo

Bypass Cache about webimageloader HOT 5 CLOSED

lexs avatar lexs commented on May 23, 2024
Bypass Cache

from webimageloader.

Comments (5)

nikreiman avatar nikreiman commented on May 23, 2024

You can set a max cache age of 1, but that would apply for all requests (and is also a bit hacky):

https://github.com/lexs/webimageloader/blob/master/webimageloader/src/main/java/com/webimageloader/ImageLoader.java#L503

from webimageloader.

bobz avatar bobz commented on May 23, 2024

Hi Nik,

Thanks for the feedback.

I ended up "closing" the cache, opening the underlying disk LRU, and removing the item manually.

Also a huge hack, but it works for now. ;)

Best,
Jay

from webimageloader.

bobz avatar bobz commented on May 23, 2024

Here's my code if you or anyone else is curious.

https://gist.github.com/bobz/ff1a3f28ac0ead18115c

Just need to make sure you re-initialize the imageLoader later.

Bear in mind, this works ok because this is a rare occurrence in my application, usually the default behavior is great.

from webimageloader.

lexs avatar lexs commented on May 23, 2024

There's currently no way of asking the library to bypass the cache but I'll look into adding it. Another workaround (that may not fit you) is adding a random query parameter to your url like ?cache-bust=1234.

from webimageloader.

atomfrede avatar atomfrede commented on May 23, 2024

So you mean when adding a custom query parameter the image is not delivered from the cache because it was saved with a different key before? Good to know :)

from webimageloader.

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.