(ios) Added a NSURLRequestReloadIgnoringLocalCacheData policy when lo… #1471
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…ading requests
Platforms affected
Motivation and Context
There is a problem with iOS where the diskcache aka .js, html, and css etc files are cached between .ipa installs.
When updating
.ipa
bundles in the Apple AppStore, it was evident that when using thefileURL
system the WKWebView holds onto a previously cached cordova framework files. This can result in a fatal when booting the application if you remove a plugin. If this happens thecordova_plugins.js
file doesn't get updated, so it tries to load the deleted plugin. This creates a hard blocking result, since the plugin files don't exist, so cordova cannot load the plugin (even though it should be removed)There is no issue for this at this time, I was discussing it with Norman Breau in the Slack Space
Description
This is a follow up Pull Request to this request:
#1451
Instead of flushing cache at the boot of the cordova framework. It was suggested to just ignore local cache when
loadRequest()
is called.So when cordova runs the
loadRequest
function in theCDVWebViewEngine.m
file, we apply aNSURLRequestReloadIgnoringLocalCacheData
cache policy to the request. This should ignore any cached instances and pull the files directlyTesting
Loaded our local dev app with the new policy applied to requests. Inspected the Network of the device to track down if the app is using files from the WKWebView Cache or not.
We also are still getting these errors into our error reporting systems.
I can validate that these start to stop coming in completely on the new version of our production application.
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)