Ensure URL caching is disabled in order to prevent from duplicate caching
This commit is contained in:
parent
a230f6aba8
commit
439c01527f
|
@ -47,11 +47,13 @@ static NSOperationQueue *downloadQueue;
|
||||||
downloadQueue.maxConcurrentOperationCount = max;
|
downloadQueue.maxConcurrentOperationCount = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)main
|
- (void)main
|
||||||
{
|
{
|
||||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
|
||||||
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:url]];
|
// In order to prevent from potential duplicate caching (NSURLCache + SDImageCache) we disable the cache for image requests
|
||||||
|
NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:5];
|
||||||
|
UIImage *image = [UIImage imageWithData:[NSURLConnection sendSynchronousRequest:request returningResponse:nil error:NULL]];
|
||||||
|
|
||||||
if (!self.isCancelled && [delegate respondsToSelector:@selector(imageDownloader:didFinishWithImage:)])
|
if (!self.isCancelled && [delegate respondsToSelector:@selector(imageDownloader:didFinishWithImage:)])
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue