In my phonegap app, I have a feature to download new JS and HTML files and update into www folder. After updating, I need to clear old cached js & html files (without killing app and relaunching). In Android, I call DroidGap.appView.clearCache(true) to do this. But I did not find any similar method in iOS. I tried several ways:
Delete shared cache
[[NSURLCache sharedURLCache] removeAllCachedResponses];
NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
[NSURLCache setSharedURLCache:sharedCache];
Clear cache of ASIHTTPRequest (I use this lib)
[[ASIDownloadCache sharedCache] clearCachedResponsesForStoragePolicy:ASICachePermanentlyCacheStoragePolicy];
But none of them can resolve this problem. Anyone can help me? I really appreciate any help you can provide.