## 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](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/01_title_blazor_server_dotnet11.webp)

---

## 1. The Blazor Rendering Continuum

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

```mermaid
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](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/02_blazor_rendering_modes_architecture.webp)

---

## 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](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/03_dotnet11_static_ssr_innovations.webp)

### 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](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/04_quickgrid_static_ssr_no_websocket.webp)

### 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.

```razor
<CacheView Expiration="TimeSpan.FromMinutes(2)" VaryByQuery="@(new[] { "page", "sort", "dir" })">
    <CustomerHelpLibrary />
</CacheView>
```

![CacheView Component Code](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/05_cacheview_component_code.webp)

### 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](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/06_static_ssr_clientside_validation.webp)

### 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](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/07_label_displayname_tempdata_code.webp)

---

## 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](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/08_persistent_component_state_code.webp)

![Aspire Logs Single Load Verification](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/09_aspire_logs_single_load_verification.webp)

### 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](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/10_aspire_circuit_metrics_disconnect_test.webp)

---

## 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](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/11_circuit_pause_resume_deployment_architecture.webp)

### 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](/dotnetconf2026/archive/23-blazor-server-dotnet11/screenshots/12_autopause_hidden_tab_circuit_reclamation.webp)

---

## 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 |
