Add the ability to set max cache age.

This commit is contained in:
Kevin Monahan 2012-07-11 17:16:07 -04:00 committed by Olivier Poitrey
parent 7b941a0cb2
commit 0e075907a4
2 changed files with 12 additions and 0 deletions

View File

@ -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.
*

View File

@ -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