-
Book Overview & Buying
-
Table Of Contents
Web Development with Blazor - Fourth Edition
By :
You might have noticed that when Blazor loads our list of blog posts, it loads fast, then flickers, and then shows the content again.
This is because of pre-rendering. Blazor first renders the content on the server, and when the site becomes interactive, another hosting model steps in and does not reuse the state. This was a common problem when .NET 8 was released, because prerendering became the default behavior.
Blazor is not alone with prerendering; Angular has SSR as well as NextJS (for React). The reason this is a good thing is that it loads faster and works well with SEO. A site that doesn't prerender needs to fully load before getting the information, which, at least as perceived, loads slowly.
There was a way to handle Persistent Component State manually, but it involved a lot of code, and the benefit wasn't clear enough. It might be an internal site that didn't need SEO, so the effort wasn't worth it and developers ended up turning...