Blazor WebAssembly vs Blazor Server
To run Blazor applications you can choose to run your client-side code on either the browser on the Server.
If you choose to run your frontend code on the browser, Blazor will use WebAssembly to run the .NET runtime in the browser.
There are some advantages and disadvantages to both of these so lets take a look
In the WebAssembly hosting model
- UI updates will feel much faster because no back and forth is needed between the client and the server for DOM events
- Can be deployed to a CDN without the need for a backend server
In the Server hosting model
- The C# code runs on the server so there is no need to download the CLR and assemblies, meaning the first request will be faster than in the Web Assembly model
- UI updates might feel a bit slower due to the fact thet each request needs to travel to the server, wait for it to generate the latest DOM changes and deliver them over web sockets back to the frontend
- A .NET server is required to host it
A note on browser compatibility - most modern browsers will support WASM and Blazor, but keep in mind that if you need to support older browsers like IE 11, make sure to check the browser compatibility tables on caniuse.com for both Web sockets and Web Assembly and see which model works for you.