02/16/2020
Problem
Using WebAssembly based Blazor is one great technology to create static websites using C# and mono. Unfortunately search engines are not yet good enough to index WebAssembly based websites. A way to overcome this issue is to create a Host service which only does pre-render and serve the files for the static website. This way search engines can load the pre-rendered HTML page, and index that.
When the webassembly based, client side, static page is fully loaded and initialized, the same state must be re-created as the pre-rendered page had during rendering. If initiating this state includes an async operation, such as fetching data from a service, the Blazor client might finish the first render before the required data is available. Without data, the first render will render an empty page. Once the state initialized a new render will re-create the same (or similar) DOM as the pre-rendered page had. Having these 2 renders results a huge 'flash' like experience for the user, where an empty page is rendered for a moment.
Proposal
Find out more