What’s the difference between RenderMode.Server and RenderMode.ServerPrerendered in blazor?

Explained at ASP.NET Core and Blazor updates in .NET Core 3.0 Preview 9:

  • Static Statically render the component with the specified parameters.
  • Server Render a marker where the component should be rendered interactively by the Blazor Server app.
  • ServerPrerendered Statically prerender the component along with a marker to indicate the component should later be rendered interactively by the Blazor Server app.

This concept is related to performance. The fastest way to serve a page is to render page statically then send, and, the slowest way to serve a page is to serve an “interactive Blazor” server page (with a live virtual DOM synchronized via SignalR websockets).

ServerPrerendered is a trade-off: Blazor pre-renders page and sends it as a static page, then later the page becomes an interactive Blazor server app. This behavior is intended to serve pages quickly to search engines with time-based positioning.

Leave a Comment