Blazor and the Rendering Vocabulary: SSR, CSR, SSG, and ISR in ASP.NET Core

Automated English translation of the original Spanish article. Code examples keep their original identifiers.

Blazor does not talk about CSR, SSR, SSG, or ISR: it talks about render modes. But beneath those names lie the same familiar decisions: who generates the HTML, when, and where interactivity lives.

In the previous article, SSR, CSR, SSG, and ISR: Understanding Modern Rendering Strategies, we reviewed those four strategies in general. Here, we translate them into the ASP.NET Core world: which render mode corresponds to each acronym, which one doesn’t fit into any of them, and what is needed to get closer to SSG and ISR.

If you are already familiar with render modes, this article serves as a map. If you want to dive deeper into each one, I link the complete Blazor series at the end.

The Map: Render Modes vs. the Acronyms

Three of the four render modes have an approximate equivalent; Interactive Server is the exception, and SSG and ISR do not come out of the box.

Render modeWhere initial HTML is generatedWhere interactivity livesApproximate equivalent
Static SSRServer, on each requestNo .NET interactivitySSR
Interactive ServerServer (with prerendering)Server, via SignalR connectionNo exact match
Interactive WebAssemblyServer (prerendered), then browserBrowserCSR (with initial prerendering)
Interactive AutoServer initially, then browser on subsequent visitsServer first, then WebAssemblySSR + CSR
(non-native)Build—SSG, with community packages
(non-native)Server + cache—Something akin to ISR, with output caching

Watch out for a naming detail: Microsoft refers to Interactive Server as interactive SSR, even though its behavior is quite far removed from classic SSR. We’ll look into that below.

Static SSR: Classic SSR

Static SSR is pure SSR: the component executes when the request arrives, Blazor converts it to HTML, and once the response is sent, the server discards the component’s state. Only HTML remains in the browser.

In an online store, a product page in Static SSR queries the database, returns the current price and stock, and neither downloads the .NET runtime to the browser nor establishes an interactive circuit. This is what I recommended for landing pages and content in Choosing and Applying Render Modes.

There is an important distinction: not downloading the .NET runtime does not mean the application cannot use Blazor’s JavaScript. A Blazor Web App can load blazor.web.js to enable features like enhanced navigation and enhanced forms, even when using Static SSR.

Two features make it more comfortable than traditional SSR:

  • Streaming rendering: using the [StreamRendering] attribute (in .NET 8, [StreamRendering(true)]), Blazor first sends the page with placeholders and then streams in the slower parts, such as an expensive query, within the same response.
  • Enhanced navigation and forms: Blazor intercepts links and form submissions to prevent full page reloads, even though everything continues to render on the server.

The limitation is that there are no client-side .NET events. A button with @onclick will not execute its handler because there is no interactive circuit. Forms, however, can work through Blazor’s static form handling: the browser sends an HTTP request, and the server processes the data and generates a new response.

For example, EditForm can be used in this scenario alongside FormName and [SupplyParameterFromForm] to identify and bind the submitted data.

Interactive WebAssembly: .NET’s CSR

Interactive WebAssembly is CSR: the .NET runtime and your assemblies are downloaded to the browser, and the UI executes there. Microsoft’s own documentation describes it as client-side rendering.

The difference from a classic SPA is that, by default, the server prerenders the page. The user sees real HTML right away, and once WebAssembly finishes loading, the component begins running in the browser. This is the hydration we discussed in the previous article, even if Blazor doesn’t use that term.

This prerendering comes with a known cost: the component is instantiated and executes its lifecycle twice—once during server prerendering and once when execution begins in the browser. If you don’t account for this behavior, you might duplicate database queries and other initialization operations.

To avoid this, you can use PersistentComponentState, as I explain in State, Lifecycle, and Pitfalls.

Useful when interactivity is heavy and you want to offload the server: editors, dashboards with client-side computation, or offline functionality. The trade-off is the initial download size of the runtime and required assemblies.

Interactive Server: The Mode That Fits No Acronym

Interactive Server is neither SSR nor CSR, even if Microsoft calls it interactive SSR. The HTML is generated on the server, yes, but the component stays alive there after the first response: every click travels over a SignalR connection, the server executes the corresponding handler, recalculates the UI, and sends DOM diffs back to the browser.

In the SSR discussed in the previous article, the server responds and forgets. Here, the server remembers: it maintains a “circuit” with the state of each connected user. That introduces consequences that don’t appear in any acronym comparison table:

  • Memory per user: state lives in server RAM, so the number of concurrent users directly impacts infrastructure costs.
  • Connection dependency: if the connection drops or the user reloads, in-memory state can be lost unless you configure appropriate persistence mechanisms.
  • Response caching: a page whose initial HTML contains user-specific data must not be served from a shared cache without an adequate isolation strategy. This does not preclude caching public data or user-independent content.

In return, it offers something neither SSR nor CSR can provide alone: full C# interactivity without downloading the .NET runtime to the browser, plus direct access to server-side services, including the database. That is why it excels in internal tools with limited user counts.

The closest equivalents lie outside the JavaScript ecosystem, such as Phoenix LiveView or Livewire, which we will look at in the PHP article.

Interactive Auto: Two Execution Models, Depending on the Visit

Interactive Auto combines prerendering and interactivity, but with an important caveat: it does not dynamically convert a component currently running on the server into a WebAssembly one.

On a first visit, the component is prerendered on the server and uses Interactive Server to deliver interactivity. Meanwhile, the .NET runtime and application assemblies download in the background and are cached by the browser.

On subsequent visits, once that bundle is readily available, Blazor can use Interactive WebAssembly to run the component on the client.

Therefore, Auto does not mean that a single SignalR circuit morphs into WebAssembly execution. They are distinct execution models, and Blazor selects which one to use when bootstrapping interactivity. A running instance never changes models mid-lifecycle.

This is Blazor’s way of avoiding WebAssembly’s initial loading delay without giving up the benefit of offloading the server on repeat visits. However, it is also the most complex architecture: your code must run on both server and client, with services accessing the database directly on one side and calling an API on the other.

I detail that design in Real-World Architecture, Decisions, and Trade-offs.

In terms of the previous article, Auto is a strategy that blends SSR and CSR across different visits, rather than simply mixing both models within a single instance.

What About SSG and ISR? What Blazor Doesn’t Include Out of the Box

Blazor does not natively include static site generation or ISR comparable to what specialized frameworks offer. You can get close to both, but you need extra tooling.

SSG with community packages. Several projects run your pages at publish time and output the results as static HTML files:

  • BlazorStatic: turns a Blazor app into a static site, with support for Markdown and front matter, geared towards blogs.
  • AspNetStatic: generates static files from any server-rendered ASP.NET Core site, including Blazor SSR, allowing you to mix static and dynamic pages.
  • BlazorWasmPreRendering.Build: prerenders a WebAssembly app at publish time so it can be hosted as static files with improved SEO.

These are community projects, not official tools: review their maintenance status, compatibility with your .NET version, and limitations before committing to them.

Something akin to ISR with output caching. ASP.NET Core’s output caching middleware stores HTTP responses generated by the application and serves them without re-executing request processing while the cache entry remains valid.

When applied to a Static SSR page, the effect is close to ISR: the server can deliver a cached version for a given period and generate a new one once the cache expires or is invalidated.

For example, we can register a policy for the product catalog:

builder.Services.AddOutputCache(options =>
{
    options.AddPolicy("CatalogoPublico", p => p
        .Expire(TimeSpan.FromSeconds(60))
        .Tag("productos"));
});

app.UseOutputCache();

This registers the policy and enables the middleware, but you still need to map the policy to the endpoints you want to cache. In a Blazor Web App, the MapRazorComponents builder lets you apply endpoint conventions:

app.MapRazorComponents<App>()
    .CacheOutput("CatalogoPublico");

This example applies the policy to the endpoints generated by that MapRazorComponents call. If your application mixes Static SSR pages with interactive pages or personalized content, you should avoid applying a global policy without verifying which responses are being cached. Caching must be restricted to public responses that can be safely shared.

When a price changes, you can invalidate the entries associated with the tag:

await outputCacheStore.EvictByTagAsync(
    "productos",
    cancellationToken);

The next request requiring an invalidated response will re-render the content and store a fresh version.

There is another crucial detail in production: by default, output caching uses in-process memory storage. If you have multiple application instances behind a load balancer, each may maintain its own cache. Invalidating a tag on one server will not automatically invalidate entries on the others. For that scenario, you need shared storage—such as the Redis-backed output caching provider provided by ASP.NET Core—or a coordinated invalidation strategy.

Keep in mind that output caching applies default constraints: it does not cache responses that set cookies or responses to authenticated requests, among other conditions. It is not a mechanism to enable indiscriminately for pages with personalized data.

CacheView: Fragment Caching in .NET 11

.NET 11 introduces another interesting piece for Blazor: CacheView.

Unlike output caching, which caches complete HTTP responses, CacheView caches the rendered output of a Razor component subtree during Static SSR.

For example:

<CacheView VaryByQuery="category"
           ExpiresAfter="TimeSpan.FromMinutes(5)">
    <ProductList Category="@Category" />
</CacheView>

In this case, Blazor retains the markup generated by ProductList for five minutes, varying the entries based on the category URL query parameter.

When a cache hit occurs, Blazor reuses the stored markup without re-instantiating or running the lifecycle of the components within that subtree.

This is particularly useful for expensive, relatively static sections of a page that do not require caching the entire HTTP response.

There are some important considerations:

  • CacheView operates during Static SSR on GET requests; it is not a cache for components already running interactively.
  • You must correctly define the dimensions that make up the cache key using parameters like VaryByQuery, VaryByRoute, VaryByUser, or VaryByCulture.
  • If content depends on user identity, permissions, or personal data, you must isolate the cache entries properly. Varying by user does not automatically incorporate all their claims or permissions into the key.
  • Components containing data that must update on every request require special handling or should remain outside the cached subtree.

The distinction between both mechanisms is straightforward:

MechanismWhat it caches
Output cachingFull HTTP responses
CacheViewRendered markup of a component subtree

I wouldn’t frame CacheView as an ISR implementation. It is a fragment caching capability during Static SSR, not a static page generation and background regeneration system.

This connects back to my homegrown ISR with Hugo and cron: different tools, same goal of serving fast without sacrificing fresh content.

The Same Criteria, Different Vocabulary

Blazor does not invent brand-new strategies, aside from one significant architectural quirk: Interactive Server, which keeps UI state alive on the server via SignalR circuits.

The rest are the same familiar decisions under different names, and they can be mixed on a per-page or per-component basis. SSG and ISR require external solutions, and ASP.NET Core’s caching capabilities shouldn’t be mistaken for a static generation system.

The recommended approach remains the same as in the overview article: start with Static SSR, introduce output caching where the content allows, and if you are on .NET 11 or later, use CacheView when you need to cache specific fragments. Turn on interactivity only for components that genuinely require it.

If you want to dive deeper, here is the complete Blazor series on the blog:

In the next article of the series, we’ll examine how PHP tackles these exact same architectural decisions.