Android – how to invalidate glide cache for certain images

I'm writing an application that needs to load a lot of images from the Internet (comic book reader). I need to cache some thumbnails for offline use, and anything else should be cleared when the application is closed

I read some content about Cache Invalidation on glide page. They said that the best way is to change the content URL, but how does glide know whether it is the modified URL of old content or new content? I'm new to glide

https://github.com/bumptech/glide/wiki/Caching-and-Cache-Invalidation

Thank you in advance:)

resolvent:

You can load pictures using the following:

Glide.with(context)
    .signature(new StringSignature(yourVersionMetadata))
    .into(imageView)

Just change yourversionmetadata when loading the image. If yourversionmetadata is different, it will not be loaded from the cache

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>