You're right to investigate this—an 8-second initial load time is definitely on the high side for a Blazor Server app, even with EF Core.
Even though you're warming up the DbContext, that only helps with one part of the cold start. EF Core model building typically takes less than 1.5 seconds, so the remaining delay likely comes from other parts of the application.
Here are a few things to consider:
Blazor Server Cold Start
Blazor Server apps need to initialize SignalR connections, Razor components, and set up dependency injection. These steps can add a few seconds, especially during the first request after deployment or application pool recycling.
EF Core Model Precompilation
Instead of building the EF model at runtime, you can pre-compile it during build time to reduce startup time. This is available in EF Core 7 and above.
Logging Can Help
Try enabling detailed logging during startup to see which parts are taking time. That might help you isolate whether it’s SignalR, dependency injection setup, or something else.
ReadyToRun Compilation
If you’re running the app from source or in development mode, just-in-time compilation can also cause delays. Publishing with ReadyToRun enabled (available in .NET publish options) can help reduce this.
Check for Auto-Migrations
If EF Core is applying database migrations on startup, that can add significant delay. Make sure migrations are not triggered automatically unless that’s expected.
To summarize, warming up the DbContext is a good move, but it's only part of the picture. The rest of the delay is likely due to app-level startup costs, not just EF Core. Pre-compiling the EF model, enabling detailed logging, and trying ReadyToRun publish can all help narrow this down.