yycache

swift - YYCache ֮ YYDiskCache

匿名 (未验证) 提交于 2019-12-03 00:38:01
YYDiskCache缓存是通过file文件,splits进行数据存储与读取操作,直接放代码 初始化方法: - ( nullable instancetype )initWithPath:( NSString *)path; - ( nullable instancetype )initWithPath:( NSString *)path NSUInteger )threshold 我们看两个方法的实现: - ( instancetype )initWithPath:( NSString *)path { initWithPath :path inlineThreshold : 1024 * 20 ]; // 20KB } - ( instancetype )initWithPath:( NSString *)path NSUInteger )threshold { init ]; YYDiskCache *globalCache = _YYDiskCacheGetGlobal (path); YYKVStorageType type; 0 ) { YYKVStorageTypeFile ; NSUIntegerMax ) { YYKVStorageTypeSQLite ; YYKVStorageTypeMixed ; YYKVStorage *kv = [[