SDWebImagePrefetcher option to only store the loaded images in the disk cache (not memory)

Created on 26 Jul 2018  路  2Comments  路  Source: SDWebImage/SDWebImage

New Issue Checklist

Issue Info

Info | Value |
-------------------------|-------------------------------------|
Platform Name | ios
Platform Version | 11.4.1
SDWebImage Version | 4.3.3
Integration Method | cocoapods
Xcode Version | Xcode 9

Issue Description and Steps

I love SDWebImagePrefetcher: I have some very large images that I know I'll need to download if the user goes to a particular screen in my app. I'd like to ensure those images are downloaded, but I _don't_ want to keep them in memory unless the user actually goes to that screen. I see .cacheMemoryOnly as an option....any chance a .cacheDiskOnly option could be added? Happy to submit a PR if you're open to it.

feature request

Most helpful comment

See 5.x's SDWebImageContextStoreCacheType feauture. You can pass .disk and let it store disk cache only.

imageView.sd_setImage(withURL: url, placeholderImage: nil, context: [.storeCacheType: SDImageCacheType.disk])

In 4.x, however we have no plan to add this.

All 2 comments

See 5.x's SDWebImageContextStoreCacheType feauture. You can pass .disk and let it store disk cache only.

imageView.sd_setImage(withURL: url, placeholderImage: nil, context: [.storeCacheType: SDImageCacheType.disk])

In 4.x, however we have no plan to add this.

For SDWebImagePrefetcher, use the context property with the context option SDWebImageContextStoreCacheType.

So, close this issue due the the solution above.

Was this page helpful?
0 / 5 - 0 ratings