[英]How to handle Blazor's "attempting to reconnect to server"?
I have a Blazor server-side app and after a period of inactivity, the message "Attempting to reconnect to server..." appears.我有一个 Blazor 服务器端应用程序,一段时间不活动后,出现消息“正在尝试重新连接到服务器...”。
I need to extend the inactivity period.我需要延长闲置期。
My questions:我的问题:
That's what I gathered:这就是我收集的:
Right now we are waiting for a fix, which I saw vaguely scheduled for .NET 8...现在我们正在等待修复,我看到它模糊地安排在 .NET 8...
The time after the message appears is the timeout for a browser to put tab to sleep.消息出现后的时间是浏览器将选项卡置于睡眠状态的超时时间。 This power saving mode is switched on even on desktops.这种省电模式甚至在台式机上也处于打开状态。 You can check the setting (and turn it off) in settings of the browser.您可以在浏览器的设置中检查设置(并将其关闭)。
As for a command to keep the tab alive, I have not come across such solution.至于让选项卡保持活动状态的命令,我还没有遇到过这样的解决方案。 There are a lot of answers online how to reload the page once it goes into sleep, but there are no answers how to prevent it in the first place.网上有很多关于如何在进入休眠状态后重新加载页面的答案,但是没有答案如何首先阻止它。
I have even seen a hack involving playing audio to fool heuristics of web browsers which put a Blazor tab to sleep...我什至看到了一个涉及播放音频以欺骗 web 浏览器的启发式方法的黑客攻击,该浏览器将 Blazor 选项卡置于睡眠状态......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.