Fast Parallel Object Cache For iOS and OS X

TMCache is an open source project from tumblr, designed to persist temporary objects that are time and/or process intensive to create.

There are two stores, one is permanent (TMDiskCache) and one is in memory (TMMemoryCache). The later is active (stored) until the app goes into the background or the OS generates a low memory warning. The permanent cache is stored continually, wherein the API provides methods to reset, or you can specify size and date (age) requirements.

Writing to and reading from the cache requires just one line for each action:

// Set an image in cache
[[TMCache sharedCache] setObject:image forKey:@"key" block:nil];
// Get image from cache
[[TMCache sharedCache] objectForKey:@"key"
                       block:^(TMCache *cache, NSString *key, id object) {
                         UIImage *image = (UIImage *)object;
                         NSLog(@"image scale: %f", image.scale);

Download TMCache from github.