Browse files

Add the ability to set max cache age.

  • Loading branch information...
1 parent 7b941a0 commit 0e075907a4a1e97698bfb9dc77ba1e944a995d77 @nivektric nivektric committed with Jul 11, 2012
Showing with 12 additions and 0 deletions.
  1. +7 −0 SDWebImage/SDImageCache.h
  2. +5 −0 SDWebImage/SDImageCache.m
View
7 SDWebImage/SDImageCache.h
@@ -28,6 +28,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.
*
* @param image The image to store
View
5 SDWebImage/SDImageCache.m
@@ -123,6 +123,11 @@ + (SDImageCache *)sharedImageCache
return instance;
}
++ (void) setMaxCacheAge:(NSInteger)maxCacheAge
+{
+ cacheMaxCacheAge = maxCacheAge;
+}
+
#pragma mark SDImageCache (private)
- (NSString *)cachePathForKey:(NSString *)key

0 comments on commit 0e07590

Please sign in to comment.