Add the ability to set max cache age.
This commit is contained in:
parent
7b941a0cb2
commit
0e075907a4
|
@ -27,6 +27,13 @@
|
|||
*/
|
||||
+ (SDImageCache *)sharedImageCache;
|
||||
|
||||
/**
|
||||
* Sets the global maximum cache age
|
||||
*
|
||||
* @param maxCacheAge The maximum length of time to keep an image in the cache, in seconds
|
||||
*/
|
||||
+ (void) setMaxCacheAge:(NSInteger) maxCacheAge;
|
||||
|
||||
/**
|
||||
* Store an image into memory and disk cache at the given key.
|
||||
*
|
||||
|
|
|
@ -123,6 +123,11 @@ static natural_t get_free_memory(void)
|
|||
return instance;
|
||||
}
|
||||
|
||||
+ (void) setMaxCacheAge:(NSInteger)maxCacheAge
|
||||
{
|
||||
cacheMaxCacheAge = maxCacheAge;
|
||||
}
|
||||
|
||||
#pragma mark SDImageCache (private)
|
||||
|
||||
- (NSString *)cachePathForKey:(NSString *)key
|
||||
|
|
Loading…
Reference in New Issue