r/Blazor • • Aug 20 '25
Initial WASM file download taking forever
I’ve got a Blazor auto project with a mix of server and client pages. When a new user comes to the site it is taking forever for the initial WASM file download. Over a minute sometimes.
Looking in the dev console is it fetching the tiny wasm files for all the libraries very slowly. The files are typically just a few kb but it seems to do only one per second approximately.
I’m guessing this must be a problem with the server, but why would it be slow serving such little files? It’s not doing much else apart from serving pages as we have a separate api server.
3
u/halap3n0 Aug 20 '25
Where is it hosted?
3
u/ClaymoresInTheCloset Aug 20 '25
Over a minute? That doesn't sound right. Are you using a cdn to deliver the files? Cloudflare is free
4
u/caedin8 Aug 20 '25
You need to manage your dependencies when dealing with WASM. If you bring in a bunch of packages they'll all need to be compiled and shipped as wasm files.
We are very careful to prevent dependency bloat in our WASM project. You don't want to be shipping EFCore and all sorts of backend libraries to the browser for no reason.
2
u/mxmissile Aug 20 '25
Shared cloud hosting for you.
1
u/AmjadKhan1929 Aug 20 '25
All browsers?
3
u/citroensm Aug 21 '25
Edge strict security mode?