Reputation: 249
When using glide I observed that glide saves cache file with hashed names. which makes it hard to delete unused images cache. For example:
In a chatting app glide saves user avatar cache in cache directory with the hashed name,after some time user changes his/her avatar and that avatar also cached by glide.
Now Problem is there are two versions of caches images of single user one is current version another is the previous version of cache which is useless and it will occupy some space
Is there any solution so that when new version come the previous version of the cache should be deleted?
Upvotes: 0
Views: 216
Reputation: 405
It looks like such functionality is not provided in last glide's releases. But the following solutions could work for you:
DiskCacheStrategy.NONE If you load image from disk than there is no need for caching thumbnails and this approach will fit your needs. But in this case images will be reloaded each time if they are retrived from network.
You can limit glide cache's size by using InternalCacheDiskCacheFactory By default it is 250 MBs.
Upvotes: 1