diff --git a/SDWebImage/SDWebImageDownloader.m b/SDWebImage/SDWebImageDownloader.m index 2f2198e8..d1ac8bb8 100644 --- a/SDWebImage/SDWebImageDownloader.m +++ b/SDWebImage/SDWebImageDownloader.m @@ -166,7 +166,14 @@ } // In order to prevent from potential duplicate caching (NSURLCache + SDImageCache) we disable the cache for image requests if told otherwise - NSURLRequestCachePolicy cachePolicy = options & SDWebImageDownloaderUseNSURLCache ? NSURLRequestUseProtocolCachePolicy : NSURLRequestReloadIgnoringLocalCacheData; + NSURLRequestCachePolicy cachePolicy = NSURLRequestReloadIgnoringLocalCacheData; + if (options & SDWebImageDownloaderUseNSURLCache) { + if (options & SDWebImageDownloaderIgnoreCachedResponse) { + cachePolicy = NSURLRequestReloadIgnoringLocalCacheData; + } else { + cachePolicy = NSURLRequestUseProtocolCachePolicy; + } + } NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy:cachePolicy timeoutInterval:timeoutInterval];