Here is the sample function I call when i need to clear cache and make a new call to URL
- (void)clearDataFromNSURLCache:(NSString *)urlString
{
NSURL *r
Whenever any API call is generated, That response is saved in the cache. You are able to find that folder in your documents directory, a folder with named cachedb is created which contains a list of responses. It can be a major concern related to security. With any third-party tool, someone can have access to that information.
Below is the way I have solved this issue :
NSURLCache *cache = [[NSURLCache alloc] initWithMemoryCapacity:0 * 1024 * 1024 diskCapacity:0 * 1024 * 1024 diskPath:nil]; [NSURLCache setSharedURLCache:cache];
I have allocated 0 memory space to the cache. so no data will be stored in Cache memory.