Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching refresh policy #141

Closed
GargManish opened this issue Sep 17, 2014 · 3 comments
Closed

Caching refresh policy #141

GargManish opened this issue Sep 17, 2014 · 3 comments
Labels

Comments

@GargManish
Copy link

Hi,

I want to apply cache refresh policy on image. I want to understand the current cache implementation logic of glide.

  1. After how long it clear image from the memory.
  2. Currently images are getting cleared if a particular image had downloaded before a time limit or if cache folder size is more than a particular size?
  3. Can we customize refresh policy.
@TWiStErRob
Copy link
Collaborator

More info on caching: https://github.com/bumptech/glide/wiki/Caching-and-Cache-Invalidation

Default memory cache is created here, it constrains in-memory size in bytes.
Default disk cache is created here, it constrains the folder size to 250MB by default.

Execute the following command (source) in command line to see what the calculated size is on your device:

adb shell setprop log.tag.MemorySizeCalculator DEBUG

You can also customize all of this and give it your own implementation(s) (I suggest you call it in your android.app.Application.onCreate before any Glide.withs):

Glide.setup(new GlideBuilder(this)
        .setMemoryCache(new MyMemoryCacheImpl())
        .setDiskCache(new MyDiscCacheImpl())
);

@sjudd
Copy link
Collaborator

sjudd commented Sep 19, 2014

For more about the setup() method @TWiStErRob mentioned, you can see the configuration wiki page too: https://github.com/bumptech/glide/wiki/Configuration

@sjudd
Copy link
Collaborator

sjudd commented Sep 29, 2014

Let us know if this doesn't cover what you're looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants