Prevent double disk caching when `SDWebImageRefreshCached` option is used #326

This commit is contained in:
Olivier Poitrey 2013-03-12 14:55:29 +01:00
parent 9b574e58bf
commit a3e3c61d46
1 changed files with 8 additions and 1 deletions

View File

@ -129,7 +129,14 @@
}
else
{
const BOOL cacheOnDisk = !(options & SDWebImageCacheMemoryOnly);
BOOL cacheOnDisk = !(options & SDWebImageCacheMemoryOnly);
if (options & SDWebImageRefreshCached)
{
// When SDWebImageRefreshCached option is enabled, the disk caching relies on NSURLCache one.
// We thus fork SDWebImage cache to be disabled so we don't duplicate the required storage space for nothing.
cacheOnDisk = NO;
}
if (downloadedImage && [self.delegate respondsToSelector:@selector(imageManager:transformDownloadedImage:withURL:)])
{