Home > OS >  Is Blazer server SSR and SPA?
Is Blazer server SSR and SPA?

Time:09-07

I heard that the Blazer server is SSR(server-side rendering). By the way, I know that the Blazer server is a single page apps (SPA). Is the Blazer server both SSR and SPA? Then, does the Blazer server first receive data through SSR method and then receive data through CSR method to implement the SPA?

CodePudding user response:

It depends on your definitions.

Blazor Server is Server Side Rendering. All the work goes on the server. It builds an html page which it passes to the client. JS client takes over, refreshes the page and then sends requests and gets bits of the page back from the server to render when they change. All the heavy lifting takes place on the server.

Blazor WASM is Client Side Rendering. The client gets a load of JS and WASM files and a small html page. It has to execute client side code to put it all together and build the page.

Both are Single Page Applications - the initially loaded page is the application. The client side code just changes out bits of the DOM to update a "page" or move between "pages".

"Pages" are components, not html pages.

CodePudding user response:

Blazor has two flavours, Blazor WebAssembly and Blazor Server. Both are used to create SPAs (which are a type of application) and both can be configured to use SSR (which is a technology). More information can be found here.

  • Related