webview2 .net delay to load a website

Mark Ismail 21 Reputation points
2021-03-14T22:51:35.673+00:00

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

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,119 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jerry Cai-MSFT 986 Reputation points
    2021-03-15T07:02:59.897+00:00

    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.

    0 comments No comments

  2. Mark Ismail 21 Reputation points
    2021-03-18T16:11:51.907+00:00

    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/")
    
    0 comments No comments