diff options
Diffstat (limited to 'iPhone/FixMyStreet/Classes/AppDelegate.m')
-rw-r--r-- | iPhone/FixMyStreet/Classes/AppDelegate.m | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/iPhone/FixMyStreet/Classes/AppDelegate.m b/iPhone/FixMyStreet/Classes/AppDelegate.m index 7d6bcd8..77e991d 100644 --- a/iPhone/FixMyStreet/Classes/AppDelegate.m +++ b/iPhone/FixMyStreet/Classes/AppDelegate.m @@ -43,6 +43,11 @@ [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; + int cacheSizeMemory = 8 * 1024 * 1024; // 8MB + int cacheSizeDisk = 32 * 1024 * 1024; // 32MB + NSURLCache* sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"]; + [NSURLCache setSharedURLCache:sharedCache]; + self = [super init]; return self; } @@ -109,4 +114,9 @@ return supportedInterfaceOrientations; } +- (void)applicationDidReceiveMemoryWarning:(UIApplication*)application +{ + [[NSURLCache sharedURLCache] removeAllCachedResponses]; +} + @end |