How to reduce the number of wasm libraries loading at the first load

Mayank Nisar 5 Reputation points
2024-05-06T12:32:40.0633333+00:00

Hello,

We are facing issue with loading Blazor web assembly app.

We have observed that the Blazor web assembly project loads a lot of wasm libraries in the beginning. It loads around 25mb of data in first load. And this is impacting performance of our app. Please see the screenshot of initial load.User's image

This is a part of the list of wasm it downloads. The list is too long.

Do we have any way we can reduce the number of wasm libraries that loads in the beginning. Or can we avoid loading unwanted libraries?

Please help.

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,495 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 61,181 Reputation points
    2024-05-06T16:03:48.67+00:00

    You reduce the number of libraries by limiting the number used. Blazor already trims unused. To be able to trim, the runtime is a lot of little libraries rather a couple large ones. Your list seems pretty normal. The main downside of Blazor WASM is downloading the .net runtime support. Y

    If you use net 8, you can have the server pre-render the startup page. ou can try Blazor AOT, but this is typically a larger download.

    0 comments No comments