Update some comments related to naming changes
This commit is contained in:
parent
2bfdac1f60
commit
2489913e95
|
@ -15,7 +15,7 @@
|
|||
// All of these method are called from the same global queue to avoid blocking on main queue and thread-safe problem. But it's also recommend to ensure thread-safe yourself using lock or other ways.
|
||||
@required
|
||||
/**
|
||||
Create a new disk cache based on the specified path.
|
||||
Create a new disk cache based on the specified path. You can check `maxDiskSize` and `maxDiskAge` used for disk cache.
|
||||
|
||||
@param cachePath Full path of a directory in which the cache will write data.
|
||||
Once initialized you should not read and write to this directory.
|
||||
|
|
|
@ -172,10 +172,10 @@
|
|||
|
||||
// If our remaining disk cache exceeds a configured maximum size, perform a second
|
||||
// size-based cleanup pass. We delete the oldest files first.
|
||||
NSUInteger maxCacheSize = self.config.maxDiskSize;
|
||||
if (maxCacheSize > 0 && currentCacheSize > maxCacheSize) {
|
||||
NSUInteger maxDiskSize = self.config.maxDiskSize;
|
||||
if (maxDiskSize > 0 && currentCacheSize > maxDiskSize) {
|
||||
// Target half of our maximum cache size for this cleanup pass.
|
||||
const NSUInteger desiredCacheSize = maxCacheSize / 2;
|
||||
const NSUInteger desiredCacheSize = maxDiskSize / 2;
|
||||
|
||||
// Sort the remaining cache files by their last modification time or last access time (oldest first).
|
||||
NSArray<NSURL *> *sortedFiles = [cacheFiles keysSortedByValueWithOptions:NSSortConcurrent
|
||||
|
|
|
@ -321,7 +321,7 @@ typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) {
|
|||
#pragma mark - Cache Info
|
||||
|
||||
/**
|
||||
* Get the size used by the disk cache
|
||||
* Get the total bytes size of images in the disk cache
|
||||
*/
|
||||
- (NSUInteger)totalDiskSize;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#import "SDDiskCache.h"
|
||||
|
||||
static SDImageCacheConfig *_defaultCacheConfig;
|
||||
static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
|
||||
static const NSInteger kDefaultCacheMaxDiskAge = 60 * 60 * 24 * 7; // 1 week
|
||||
|
||||
@implementation SDImageCacheConfig
|
||||
|
||||
|
@ -31,7 +31,7 @@ static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
|
|||
_shouldRemoveExpiredDataWhenEnterBackground = YES;
|
||||
_diskCacheReadingOptions = 0;
|
||||
_diskCacheWritingOptions = NSDataWritingAtomic;
|
||||
_maxDiskAge = kDefaultCacheMaxCacheAge;
|
||||
_maxDiskAge = kDefaultCacheMaxDiskAge;
|
||||
_maxDiskSize = 0;
|
||||
_diskCacheExpireType = SDImageCacheConfigExpireTypeModificationDate;
|
||||
_memoryCacheClass = [SDMemoryCache class];
|
||||
|
|
Loading…
Reference in New Issue