Tutorials Blazor Architecture & Enterprise Patterns

Lazy Loading Assemblies to reduce bundle size

On this page

On-Demand Code

In a massive enterprise app, the user might only use 10% of the features. Lazy Loading ensures they only download the code they actually need.

1. Splitting the App

You can configure specific assemblies (DLLs) to be lazy-loaded. For example, if you have a massive 'Reporting' module with heavy dependencies like Syncfusion or DevExpress, you can defer downloading that DLL until the user actually navigates to the /reports page.

2. The Navigation Hook

In your App.razor, you listen to the OnNavigateAsync event. When a user requests a lazy-loaded route, you use the LazyAssemblyLoader service to fetch the DLL from the server. Once the download is complete, Blazor automatically registers the new types, and the navigation finishes seamlessly.

3. Architect Insight

Q: "Does lazy loading help with Blazor Server?"

Architect Answer: "NO. Blazor Server only sends UI diffs; the code is already on the server. This is a **WASM-only** optimization. For Blazor WASM, it is the single most effective way to keep your 'Initial Load' time under control as your application grows to hundreds of pages."

Questions on this lesson 0

Sign in to ask a question or upvote helpful answers.

No questions yet — be the first to ask!

Blazor Architecture & Enterprise Patterns
Course syllabus
1. Blazor Foundations
2. Component Architecture
3. Data & State Management
4. SignalR & Interactivity
5. Security & Data Protection
6. Advanced Performance
7. Testing & CI/CD
8. The Blazor Architect's Case Study
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details