1

i am facing a security issue in iOS7. I want to make my url connection without any caching by doing the following configuration:

+(NSURLSessionConfiguration *)createSessionConfig {

    NSURLSessionConfiguration *sessionConfig =
    [NSURLSessionConfiguration ephemeralSessionConfiguration];

    sessionConfig.allowsCellularAccess = YES;
    sessionConfig.timeoutIntervalForRequest = 30.0;
    sessionConfig.timeoutIntervalForResource = 60.0;
    sessionConfig.HTTPMaximumConnectionsPerHost = 10;
    sessionConfig.URLCache = nil;
    sessionConfig.URLCredentialStorage = nil;
    sessionConfig.HTTPCookieStorage = nil;

    return sessionConfig;
}

When i run a NSURLSessionDataTask there is still the file Cache.db-wal created on the file system with the entries.

Can anybody tell me how to solve this issue ? I want to have no entries in the cache file on the file system.

BR, Martin

Martin
  • 790
  • 2
  • 9
  • 24

1 Answers1

0

I needed to do something very similar. Instead of setting up the configuration instance as an ephemeral session I used defaultSessionConfiguration. The ephemeral session caches into RAM rather than the disk. So by setting all of the different persistent caching properties to nil and using the default session it worked as I needed it.

BlueBear
  • 7,469
  • 6
  • 32
  • 47