You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This no longer seems to be an option with v5, hence this question. By default it seems that cached images are coming from disc. (Some images appear on screen with delay, which I previously solved by prefetching them in memory).
I saw in migration guide that v5 now splits disc and memory cache, but I am not able to figure out how to tell prefetcher to store images in memory only.
The text was updated successfully, but these errors were encountered:
xzilja
changed the title
[Question] Replicate SDWebImageCacheMemoryOnly in v5?
[Question] Replicate Prefetching images into memory (SDWebImageCacheMemoryOnly) in v5?
Apr 18, 2019
There is a context option called storeCacheType, the value type is SDImageCacheType. See the documentation about it.
/** A SDImageCacheType raw value which specify the cache type when the image has just been downloaded and will be stored to the cache. Specify `SDImageCacheTypeNone` to disable cache storage; `SDImageCacheTypeDisk` to store in disk cache only; `SDImageCacheTypeMemory` to store in memory only. And `SDImageCacheTypeAll` to store in both memory cache and disk cache. If not provide or the value is invalid, we will use `SDImageCacheTypeAll`. (NSNumber)*/
FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextStoreCacheType;
So. You just need to control your prefetcher, to use the SDImageCacheTypeMemory enum for this store cache type control.
New Issue Checklist
Issue Info
Issue Description and Steps
While using SDWebImage v4 it was possible to set options to cache images in memory only via
This no longer seems to be an option with v5, hence this question. By default it seems that cached images are coming from disc. (Some images appear on screen with delay, which I previously solved by prefetching them in memory).
I saw in migration guide that v5 now splits disc and memory cache, but I am not able to figure out how to tell prefetcher to store images in memory only.
The text was updated successfully, but these errors were encountered: