-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load a WebView page #3
Comments
WebView vendors maybe could export API like |
Maybe @rayankans can provide some input? |
Perhaps load offline resource for one party business can accelerate content display? |
Reducing the First Contentful Paint is always a huge improvement, and definitely something that should be made as simple as possible. There are many ways to address this via the Web Platform, like the prefetch/resource hints suggested by @QingAn, or potentially the use of ServiceWorkers. Assuming there is full feature parity with the Web Platform, that would improve loading times. I'm not sure what advantages prefetching from the native side would give us here. I'm more leaning towards improving Web Platform feature coverage in WebViews since it seems to be it would give the same result with less work for developers and more coverage across different WebViews. I'd love to hear some more use-cases about prefetching from from the native side however if there are any. |
I think that's what @yuanyan means by saying:
From native side, I think currently there is no option but to implement prefetching from native side, because this Web Platform feature has not been covered in WebView yet. We can further discuss the possibility and potential risk if any of supporting this feature in WebView. |
We try some experimental work. Load first party web application by an invisible WebView. When the application is updated, the server push requires the client to updated cache by reload in invisible WebView. We try to improve the cache loading rate on the user side. |
Perhaps WebView should provide official webview.prefetch(request) capability. 对于一方业务,有助于提高有缓存加载率,也可以保障缓存的新鲜度满足要求(这句话几个名词不太知道咋翻译,在下洋文水平有限,只能用中文表达了)。 |
If there is no local cache of web page resources and the network conditions are good, it will take about 1.2s to load web page. If load web resources form cache, the loading time from the disk cache is 0.5s, and load memory cache time is 0.3s. 中文对照: |
This demonstrates the benefits of pre-render of a WebView page, which includes prefetch page resources and page data. I think we share similar use cases. @rayankans In next meeting, suggest we can discuss further whether it could be listed as a valid use case? |
+1, prerendering is a good use-case.
That seems like even more reason to cover it from the Web Platform side. |
Rough consensus from 2022-05-11 meeting: https://www.w3.org/2022/05/11-webview-minutes.html#t02
|
Title: Load a WebView page
Submitter(s)
Qing An, Alibaba
Motivation:
It is quite common to use WebView in Native App development, due to WebView’s benefit of cross-platform interoperability. But the page loading performance of WebView cannot satisfy Native App well, which means the loading of a WebView page is quite slower than loading a Native page.
The above is WebView page loading, it firstly shows the white screen.
But for the Native page loading, it shows the skeleton immediately, which gives a better user experience compared with WebView.
Therefore, how to enhance the loading performance of WebView page needs to be addressed.
Stakeholders:
Stakeholders include:
Analysis
The reason of long white screen is due to serial execution in loading a WebView page. The duration of white screen directly depends on the time cost from routing intercept to JS download & parse & exec as described in the following figure.
Related W3C deliverables and/or work items:
How is the issue solved in the Browser, and what’s more is needed?
Prefetch
,Preload
andNext
are used to pre-request resources (e.g. HTML, CSS, JavaScript, Img, etc.), but they are not supported or only partly supported by WebView.Take e-commerce App as example. WebView is used to render the page of product list and product info. So, a request to fetch the data is needed, and the data is described and transferred in the format of JSON or XML. Sometimes, user info is also carried in the request, to obtain the personalized product info. If the data can be pre-requested, the performance of loading a product page can be increased.
The text was updated successfully, but these errors were encountered: