Skip to content

Instantly share code, notes, and snippets.

@nickjshearer
Created May 28, 2013 13:41
Show Gist options
  • Save nickjshearer/5662839 to your computer and use it in GitHub Desktop.
Save nickjshearer/5662839 to your computer and use it in GitHub Desktop.
Example NSURLCache setup
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Create a 4MB in-memory, 32MB disk cache
NSURLCache *cache = [[NSURLCache alloc] initWithMemoryCapacity:4*1024*1024
diskCapacity:32*1024*1024
diskPath:@"app_cache"];
// Set the shared cache to our new instance
[NSURLCache setSharedURLCache:cache];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment