Blazor server App gray out every 60 seconds

1.2k views Asked by At

I have a Blazor server-side app. When I publish the app, When browsing to an arbitrary page and just letting it idle after a minute or so (sometimes only 45 sec, sometimes something between 1 and two minutes), the screen shows a loader sign as follows, and after a few seconds screen backs to its normal state. Loader sign

How can I resolve this issue?

1

There are 1 answers

1
Nick On

The Blazor's SignalR connection times out. You may want to increase the ClientTimeoutInterval and KeepAliveInterval:

builder.Services.AddServerSideBlazor()
.AddHubOptions(options =>
{
    options.ClientTimeoutInterval = TimeSpan.FromSeconds(180);
    options.KeepAliveInterval = TimeSpan.FromSeconds(90);
});

https://learn.microsoft.com/en-us/aspnet/core/signalr/configuration?view=aspnetcore-6.0&tabs=dotnet#configure-server-options