Android webview加载速度太慢

时间:2017-10-24 10:53:01

标签: android wordpress nginx woocommerce

我运行电子商务网站并使用GA测试了访问者的页面加载速度。 (Ga已将其更改为衡量所有用户的速度。)

但不同寻常的是,Android设备上的网页加载速度很慢。

我可以在服务器端修复什么吗?我正在使用Ubuntu 16.04 + Nginx + php7 + MariaDB。

谢谢。

1 个答案:

答案 0 :(得分:1)

嗯,当然,你可能想要改变你的网站并尽可能小地让if let path = Bundle.main.path(forResource: "yourfilename", ofType: "json") { do { let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .alwaysMapped) do{ let json = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [String: Any] // you can use the json object now } 加载它,但这是一个众所周知的事情:

Android WebView并不那么快。

你可以在SO上的几个主题上看到这个问题,我的建议是改变你的Android代码,就像他们在这里做的那样:

Android webview slow

提高效果的另一种方法是让Google Chrome使用Chrome WebView为您处理网站。

https://developer.chrome.com/multidevice/android/customtabs

可以嵌入您的应用中,而无需实际使用单独的浏览器应用。