I use WebView in my UWP application and I want to clear the cache when closing the application, is there any way? I know that I can disable the cache by adding headers to my HttpRequestMessage, as indicated in this link. However, I want to clear the cache when I exit the application.
I tried WebView.ClearTemporaryWebDataAsync () without any success. Once something is cached, it usually stays in the entire application. Any help is appreciated, thanks.
Edit: add code snippet
var webView = new WebView();
webView.Navigate(new Uri("http://refreshyourcache.com/en/cache-test/"));
await WebView.ClearTemporaryWebDataAsync();
webView.Navigate(new Uri("http://refreshyourcache.com/en/cache-test/"));
I expect the static method to clear the cache, and when I go to the same page again, its cache should be cleared. Am I something wrong here?
source
share