SDWebImage: Load image with option `SDWebImageRefreshCached` get error
Issue Info
| Info | Value |
|---|---|
| Platform Name | ios |
| Platform Version | all |
| SDWebImage Version | 4.1.0 |
| Integration Method | cocoapods |
| Xcode Version | Xcode 8.3 |
| Repro rate | all the time (100%) |
| Repro with our demo prj | Yes, just add little code. |
| Demo project link | none |
Issue Description and Steps
Replace this line as the link below with code options:SDWebImageProgressiveDownload | SDWebImageRefreshCached, and run the demo. When first navigate to the detail view of an image, it will show as expect, but go back and do it again, no image show now.
https://github.com/rs/SDWebImage/blob/master/Examples/SDWebImage Demo/DetailViewController.m#L44
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (13 by maintainers)
Commits related to this issue
- Fixed #1993 Load image with option `SDWebImageRefreshCached` get error #1737 introduced an issue that is using NSURLRequestReturnCacheDataDontLoad for our cached images which makes us never download a... — committed to bpoplauschi/SDWebImage by bpoplauschi 7 years ago
- downgrade SDWebImage(4.1.0 version has some issues about caching policy) // https://github.com/rs/SDWebImage/issues/1993 — committed to younatics/MediaBrowser by Urtaq 7 years ago
- Fixed #1993 Load image with option `SDWebImageRefreshCached` get error #1737 introduced an issue that is using NSURLRequestReturnCacheDataDontLoad for our cached images which makes us never download a... — committed to Lightricks/SDWebImage by bpoplauschi 7 years ago
Reproduced. +1
I have move to using kingfisher,which has a good code quality
@bpoplauschi Sorry to bother because I do not use that
SDWebImageDownloaderIgnoreCachedResponseoptions in my iOS application. After I check the commit history but still do not understand what’s this option means. If I choose to use NSURLCache instead of SDImageCache, I means to setNSURLRequestUseProtocolCachePolicyright ? But this option seems to set back thatNSURLRequestReloadIgnoringLocalCacheData. It’s this really useful ?(You can just do not set any and this is the default behavior). Or may this means the descriptionCall completion block with nil image/imageData if the image was read from NSURLCacheSo maybe the code below can specify that behavior(but I think it’s really strange and please do not use this if I’m something wrong):