SDWebImage not caching

I upload images using [SDWebImageDownloader.sharedDownloader downloadImageWithURL] with the options set to 0. I initially do nothing with them, realizing that they will be cached. However, when I use the same function to display the image later, the function loads the image again, and does not get it from the cache (the type of image cache is 0). In both cases, the image URL is the same. Is my understanding of incorrect caching?

+4
source share
1 answer

The easiest way to use cache functionality is to use SDWebImageManagerinstead SDWebImageDownload. SDWebImageManagerprovides functionality SDImageCache, whereas if you use SDWebImageDownload, you will have to rely on NSURLCache(which has limitations / problems) or write your own cache code.

Also (and implied in Gustavo’s question), if you are just trying to install an image UIImageView, it’s actually even better not to use any of these classes and instead use a category UIImageView+WebCache. It has all the caching capabilities SDWebImageManager, but also offers other benefits (esp for re-use objects UITableViewCelland UICollectionViewCell).


, , " , , " ".

, ( , ) :

  • , , , , , WiFi ( Reachability). Apple .

  • , ( , UX , Apple , ). , , , , , , . , , , , () .

  • , , ( ) . , UIImageView, , ( , ). , 100 , . , # 90 ( , ) # 1-89?

    WWDC 2012 , GCD XPC, 7, " ", 48 , .

    , , ( - MacOS "" > "" > "" ). , ( ), , . " " , .

, , , , , , . , .

+7

All Articles