Fork Me on GitHub

Jscache

Simple and fast thread-safe key-value cache class to easily archive objects and cache images to disk (built on top of EGOCache)

Download this project as a .zip file Download this project as a tar.gz file

Description

#define JSCACHE_ENABLED 0
#define kJSCacheImageCacheDurationInSeconds 1296000 // 15 days
#define kJSCacheDataCacheDurationInSeconds 604800 // 7 days

Usage

+ (JSCache *)sharedCache;

Data caching

- (void)cacheObject:(id<NSObject, NSCoding>)object forKey:(NSString *)key;

Image caching

- (void)cacheImage:(UIImage *)image forKey:(NSString *)key;
- (void)cacheImageData:(NSData *)data forKey:(NSString *)key;

Invalidation of cached objects

- (void)invalidateCachedObjectForKey:(NSString *)key;
- (void)invalidateAllCachedObjects;