breautek commented on issue #1498: URL: https://github.com/apache/cordova-android/issues/1498#issuecomment-1257107591
So i've reproduced the issue. The behaviour on a Cordova is definitely different than the standard webview or even the desktop browser. Unfortunately that's about all I know... I tried building building a sample Android Webview app, but calling `location.reload` triggers a prompt asking if I want to open the webpage in the standard browser instead of actually reloading the webview. Cordova must override this behaviour somehow but I'm not sure how it does it. Perhaps that's the issue you have [mentioned](https://github.com/apache/cordova-android/issues/1498#issuecomment-1257095529). The android `WebView` class expose a [clearCache](https://developer.android.com/reference/android/webkit/WebView#clearCache(boolean)) API, and Cordova does have methods to call this. I'm not sure if this API is actually used at all, but it can be manually invoked from the Webview using `cordova.exec(console.log, console.error, "CoreAndroid", "clearCache", [])`. I've confirmed using AS java breakpoints that it indeed goes `clearCache(true)` on the webview. According to the documentation, it should clear the resource cache in both RAM and if `true` is passed in, it will include disk files as well. However, I saw no change in the memory usage according to the web inspector `Memory` tab. Would be interesting to get a raw Android webview test case working so that we can see if the memory issue replicates outside of a Cordova environment. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
