Hi WebView team,
In aGMM, we're experimenting with showing some of the features in the WebView and looking into ways to optimize "showing" latency.
One thing we're looking at is pre-loading WebView HTML/JS/resources. This can be done either in the native code side with shouldInterceptRequest injections later OR in WebView using ServiceWorkers to prefetch the page.
From the information I found, the former isn't recommended since shouldInterceptRequest will limit us to 3 threads and slow down rendering significantly. The latter, on the other hand, requires keeping whole WebView in memory.
Another way, is to allocate WebView and pre-render everything in background (e.g. using loadUrl()).
If we have to keep WebView in memory anyway, this seems as a better direction.
So my questions are:
Is there best-practices that proved to perform best in this use-case?
Also, Is there a way to implement lazy rendering of WebView?
Any other suggestions, pointers are more than welcome!
Thank you,
Igor