Skip to sessions and notes

These session notes are AI-generated and may contain mistakes. Verify important details against the original recording.

Blazor Server in .NET 11: Fast, resilient, and scalable

Daniel Roth

Session · 23:19 recording · 5 min read

At a glance

  • Expanding Static SSR to do more without interactive SignalR WebSocket circuits
  • QuickGrid in Static SSR: sorting & pagination using URL query strings & Enhanced Navigation
  • component: fragment caching with VaryByQuery and HybridCache
  • Client-side form validation in Static SSR embedded in blazor.web.js
  • [SupplyParameterFromTempData] & [SupplyParameterFromSession] for Post-Redirect-Get flows

Executive Summary

Blazor's server-centric model has always offered a compelling value proposition: execute application logic directly alongside enterprise databases, microservices, and authorization systems without requiring bespoke browser-facing REST or GraphQL endpoints for every operation. However, earlier iterations faced trade-offs between static pages and the resource cost of persistent real-time SignalR WebSocket circuits.

In .NET 11, Daniel Roth demonstrated how Blazor Server achieves fast delivery, unbreakable resilience, and enterprise scalability across three core pillars:

  1. Fast Static SSR (Doing More Without Circuits): Expanding Static Server-Side Rendering (Static SSR) to support sorting and pagination in QuickGrid, modern client-side form validation via blazor.web.js, reusable fragment caching via <CacheView>, and Post-Redirect-Get workflows via [SupplyParameterFromTempData] and [SupplyParameterFromSession].
  2. Resilient Interactivity: Eliminating double data loading during pre-rendering via [PersistentComponentState], coupled with automatic state snapshotting during connection dropouts.
  3. Scalability & Planned Maintenance: Introducing Circuit Pause and Resume (RequestCircuitPauseAsync()) for seamless zero-downtime server deployments, and the new Auto-Pause package (Microsoft.AspNetCore.Components.Web.AutoPause) that evicts idle and background tab circuits from server RAM.

Blazor Server in .NET 11
Blazor Server in .NET 11


1. The Blazor Rendering Continuum

Blazor provides a unified component model that spans request-based static pages and long-lived stateful interactivity:

flowchart TD
    A[Blazor Component Model] --> B[Static Server-Side Rendering<br/>Static SSR]
    A --> C[Interactive Server-Side Rendering<br/>Interactive Server]
    A --> D[Client-Side WebAssembly<br/>Interactive WebAssembly]
    
    B --> B1[No Persistent Circuit<br/>HTTP Request/Response<br/>HTML First Delivery]
    C --> C1[Server-Side State<br/>Real-Time SignalR Circuit<br/>Rich Event Dispatching]
    D --> D1[In-Browser Execution<br/>Offline Capable<br/>Pre-rendering Supported]

Blazor Rendering Modes Architecture
Blazor Rendering Modes Architecture


2. Fast: Doing More Without Circuits (Static SSR in .NET 11)

In .NET 11, developers no longer need to spin up an interactive circuit just to enable sorting, pagination, form validation, or transient confirmation banners.

.NET 11 Static SSR Innovations
.NET 11 Static SSR Innovations

1. Static SSR QuickGrid (Sorting & Pagination)

The built-in <QuickGrid> component now natively supports Static SSR. Clicking column headers to sort or clicking page numbers generates URL query string navigations (e.g. ?page=2&sort=Title). Combined with Enhanced Navigation, Blazor intercepts the link, fetches the server-rendered HTML in the background, and patches the DOM without a full page reload or WebSocket circuit.

QuickGrid in Static SSR
QuickGrid in Static SSR

2. Output & Fragment Caching (<CacheView>)

To dramatically improve server throughput, .NET 11 introduces granular component caching:

  • Response-Level Caching ([OutputCache]): Caches the entire HTTP response buffer for public, immutable pages (e.g., return policies).
  • Fragment-Level Caching (<CacheView>): Caches specific expensive component sub-trees in-memory or backed by ASP.NET Core HybridCache. Supports VaryByQuery parameters and configurable expiration spans.
<CacheView Expiration="TimeSpan.FromMinutes(2)" VaryByQuery="@(new[] { "page", "sort", "dir" })">
    <CustomerHelpLibrary />
</CacheView>

CacheView Component Code
CacheView Component Code

3. Client-Side Form Validation Without Circuits

Traditionally, Blazor form validation required either an active interactive circuit or a full server POST trip. In .NET 11, blazor.web.js embeds a modern client-side JavaScript validation engine. Form errors trigger immediately on blur without network roundtrips.

Static SSR Client-Side Validation
Static SSR Client-Side Validation

4. Post-Redirect-Get with TempData and Session State

.NET 11 introduces model binding attributes tailored for enhanced form submissions:

  • [SupplyParameterFromTempData]: Binds transient flash messages (e.g. "Thanks Alex, ticket submitted") that clear automatically after the subsequent read.
  • [SupplyParameterFromSession]: Maintains session identifiers across navigations without needing server circuits.
  • Built-in form components: <Label For="..." /> and <DisplayName For="..." /> automatically extract [Display(Name = "...")] metadata.

Label, DisplayName and TempData Code
Label, DisplayName and TempData Code


3. Resilient: Connection Loss & Pre-Rendering

For workflows requiring rich real-time UI manipulation (such as customer support agent consoles), Blazor Interactive Server provides sub-millisecond event dispatching.

Eliminating Double Data Loads: [PersistentComponentState]

Because Blazor pre-renders HTML on initial request and then spins up a separate interactive component instance upon WebSocket connection, components traditionally executed OnInitializedAsync() twice.

Marking properties with [PersistentComponentState] serializes pre-rendered state into a hidden page payload. The interactive instance restores this snapshot directly, skipping duplicate database queries. In .NET Aspire structured logs, Daniel verified the data loader executed exactly once.

Persistent Component State Code
Persistent Component State Code

Aspire Logs Single Load Verification
Aspire Logs Single Load Verification

Disconnection Recovery & Circuit Eviction

When client connectivity drops (e.g., subway tunnels, intermittent Wi-Fi):

  1. Visual Studio / Aspire metrics show connected circuits dropping from 1 to 0 while active circuits remain held in server RAM.
  2. If the client fails to reconnect before the eviction timeout, the server serializes a persistent state snapshot and terminates the circuit.
  3. When the client returns online, Blazor restores the snapshot into a brand new circuit, preserving form values, selected items, and in-flight text flawlessly.

Aspire Circuit Metrics Disconnect Test
Aspire Circuit Metrics Disconnect Test


4. Scalable: Circuit Pause, Resume & Auto-Pause

Planned Zero-Downtime Server Maintenance

Deploying backend updates to stateful Blazor Server clusters historically severed active sessions. .NET 11 introduces the Circuit Pause and Resume API:

  • CircuitHandler.RequestCircuitPauseAsync() notifies connected clients to snapshot their working state client-side.
  • The load balancer routes new traffic away from the node.
  • The server node shuts down cleanly, updates to the new build, and restarts.
  • Clients reconnect and resume their persisted state without losing uncommitted user data.

Circuit Pause Resume Deployment Architecture
Circuit Pause Resume Deployment Architecture

Reclaiming Inactive RAM with Auto-Pause

Idle browser tabs represent massive wasted memory on Blazor Server hosts. By adding Microsoft.AspNetCore.Components.Web.AutoPause, Blazor integrates with the browser Page Visibility API:

  • When a user minimizes or switches away from a tab, an auto-pause timer starts (e.g., 8 seconds).
  • The circuit is paused and evicted from server RAM. In .NET Aspire metrics, active circuits drop to 0.
  • The instant the user tabs back, the circuit re-hydrates seamlessly with zero data loss.

Auto-Pause Hidden Tab Circuit Reclamation
Auto-Pause Hidden Tab Circuit Reclamation


Summary Feature Matrix

Feature Legacy Blazor Server (.NET 8/10) .NET 11 Architecture
QuickGrid Sorting/Paging Required Interactive Circuit Works in Static SSR via URL query strings
Form Validation Required Interactive Circuit or Full Post Client-side validation in blazor.web.js
Fragment Caching Custom cache services / manual logic Declarative <CacheView> + HybridCache
PRG TempData Binding Manual ITempDataDictionary plumbing Declarative [SupplyParameterFromTempData]
Pre-rendering Redundancy Duplicate OnInitializedAsync DB queries [PersistentComponentState] (1 DB query)
Network Disconnects Reconnect dialog or session lost State snapshot + restore into new circuit
Server Maintenance Abrupt WebSocket drop & lost state RequestCircuitPauseAsync() graceful restart
Idle Tab Resource Cost Constant server RAM consumption Auto-Pause circuit eviction & instant resume