Coil: Clear Coil Cache

Created on 14 Oct 2019  路  2Comments  路  Source: coil-kt/coil

Is your feature request related to a problem? Please describe.
I have a project where I update the user's profile photo. It just uses the same URL but updates the content. When I try to reload it, (I think) it just gets the value from the cache.

Describe the solution you'd like
Maybe a load(url) { clearCache() }
or a load(url, useCache = false) { ... }

Or am I missing something here? Using either the networkCachePolicy, diskCachePolicy, or memoryCachePolicy doesn't seem to work

enhancement

Most helpful comment

Using this will guarantee that your request is always loaded from the network:

imageView.load(url) {
    diskCachePolicy(CachePolicy.DISABLED)
    memoryCachePolicy(CachePolicy.DISABLED)
}

All 2 comments

Using this will guarantee that your request is always loaded from the network:

imageView.load(url) {
    diskCachePolicy(CachePolicy.DISABLED)
    memoryCachePolicy(CachePolicy.DISABLED)
}

Thanks, Colin! Works as expected. I might've just missed this 馃檪

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RubenGonzalezGonzalez picture RubenGonzalezGonzalez  路  6Comments

GeniusRUS picture GeniusRUS  路  4Comments

wooldridgetm picture wooldridgetm  路  3Comments

r4phab picture r4phab  路  6Comments

cioccarellia picture cioccarellia  路  3Comments