I've tried all of these solutions but none of them work every single time. My main test was an html page with an image set as a background in the html page. This html page and image are downloaded locally on my iPad through a "sync" method i have written. The only way to keep the cache fully reset is the constantly change the url of the image in the html page so it thinks it's a unique image each time. For example in my html:
<body background="image.png?v123">
So each page change i make i have to update the version number:
<body background="image.png?v1234">
etc, etc. You can change the url in anyway you want, it just has to be different.
Well i'm tired of doing this. Now When i download content locally, I am instead dynamically changing the containing folder's name. Since this folder is a parent folder and all of my links are relative it means i don't have to edit my html files each time. So far it seems to be working ok. I wish these other methods were consistent as it would be so much easier to simply reset the cache.
So in my requests its the baseURL which is causing my cache to reset, not the query string to my url or background image, or css file, etc, etc.
NSString *myURL = @"index.html";
NSURL *baseURL = [NSURL fileURLWithPath:@"FULL_PATH_TO_DOCS/MYFOLDERV123"];
[myTargetWebView loadHTMLString:myURL baseURL:baseURL];