如何在调用其相应的API之前要更新Angular客户端?
我将Angular 13用作连接到.NET Core后端的客户端。
当后端API和客户端都重新部署到服务器时,我如何确保在重新启动或至少被迫重新启动的不兼容客户端将立即更新。
这对我来说似乎是一个普遍的问题,我还没有找到有关该主题的任何指导和/或最佳实践。
但是,我发现了一个有关已更改。
我应该手工发现它还是Angular提供了一些工具?
该文档指出:为了速度,服务工作者在为其缓存的应用程序服务之前不等待检查更新。
是否有办法绕过这一点?
I'm using Angular 13 as a client connecting to a .NET Core backend.
When both the backend API and the client are redeployed to the servers, how can I make sure the preexisting incompatible clients will be updated as soon as they are relaunched, or at least forced to be relaunched.
This seems a common problem to me and I have not found any guidance and/or best practices on the subject.
I've, however, found one question about detecting that the client has changed.
Should I discover it by hand or does Angular provides some tooling to do so ?
The doc states this : In the interest of speed, the service worker doesn't wait to check for updates before it serves the application that it has cached.
Is there a way to circumvent that ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可以使用 nofollow noreferrer“> serviceworker update upsions 何时检查客户更新用户打开WebApp。
您还可以经常检查客户端更新( link> link )你想要。
如果服务器上存在客户端更新,则可以迫使用户到“ nofollow noreferrer”>安装“它并重新加载页面。
在角文档中,如果您打开上面的链接,则有一些示例
I think you can use ServiceWorker Update Service to check for client updates when the user open the webapp.
You can also check for client updates frequently (link) if you want.
If a client update is present on the server you can force the user to "install" it and reload the page.
In the angular documentation there are some example if you open the links above