AnswerBun.com

Manually save Bitmap or ByteArray into cache and manually delete one cache image using image url

  1. When I upload an image to server, I want to cache it in storage in Glide with Bitmap or ByteArray so once it is uploaded, I do not have to download it from server. I can achieve this using SDWebImage in iOS, but I can’t find how to do this in Glide.

    [((SDImageCache *)webImageManager.imageCache) storeImage:image forKey:downloadURL completion:nil];

  2. Is there a way to manually delete just one cached image using one ImageURL? If image isn’t needed again, I want to delete it from the user’s device so it doesn’t use user’s device memory. Here too I can achieve this using SDWebImage in iOS, but I can’t find how to do this in Glide.

    [((SDImageCache *)webImageManager.imageCache) removeImageForKey:imageUrl withCompletion:nil];

Thank you for your expertise

Stack Overflow Asked by coolcool1994 on January 28, 2021

1 Answers

One Answer

There is no interface in glide(or other image caching libs) to delete particular image from cache. You can clear entire cache. But you can skip caching in glide for particular image URI Use diskCacheStrategy(DiskCacheStrategy.NONE) to avoid disk caching and skipMemoryCache() to avoid caching in memory. for more information on glide caching http://bumptech.github.io/glide/doc/caching.html#cache-invalidation

Answered by alokHarman on January 28, 2021

Add your own answers!

Related Questions

Center a grouped bar chart in R (ggplot2)

2  Asked on December 20, 2021

   

Node js – public subfolder

1  Asked on December 20, 2021 by andres-darwin

 

Syntax error on getting multiple range VBA

0  Asked on December 20, 2021 by michael-norman

     

what can make my form not to see my input value

2  Asked on December 18, 2021 by michael-august

     

Regex Match/Wildcard

1  Asked on December 18, 2021 by ovenbakedpython

     

javascript async and await event listener: Pokemon

1  Asked on December 18, 2021 by jason-todd

   

Why do I want to use CRTP over simple template for static polymorphism?

2  Asked on December 18, 2021 by diveintoml

   

Check if string in path and do something

2  Asked on December 18, 2021

 

sql, delete duplicate records using an ID

2  Asked on December 18, 2021 by user12929912

     

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved.