question

MarkIsmail-5186 avatar image
0 Votes"
MarkIsmail-5186 asked ·

webview2 .net delay to load a website

I am big fan of Webview2. I love it, only one problem. It is slow to load a webpage. The old Webbrowser is faster? How is that possible? On the other hand, Edge chromium is super fast. I don't understand that part. Thanks Mark

dotnet-runtime
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JerryCai-MSFT avatar image
0 Votes"
JerryCai-MSFT answered ·

Hi,Marklsmail

To make website run faster, you can try to store pics or pages as a cache. Because most of the time is used to load different parts of the page, like images,

stylesheets, and scripts.

Try load css and javascript synchronously, so elements can be loaded without waiting each other.

You can check this to view more factors that will affect page's loadingf speed:

page-speed

And the reason why chorme is faster, it uses javascript V8 engine, so it can run javascripts faster, and it also integrates part of the webkit core, so

chrome browser opens web pages very fast.

Best Regards.
Jerry Cai


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MarkIsmail-5186 avatar image
0 Votes"
MarkIsmail-5186 answered ·

It was my mistake. Webview2 was not initialized and it was taking up to 8 seconds.


'Start initialisation
Form OnLoad

 WebView2.Source = New Uri("https://www.google.com/")
·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.