[英]Angular service worker not running automatically without specifying interval
My SPA is running in prod and i want to reload the page whenever a deployment is done.我的 SPA 在 prod 中运行,我想在部署完成时重新加载页面。 I can make this work by specifying interval to check for update every X minute but that won't be the appropriate way.
我可以通过指定间隔每 X 分钟检查一次更新来完成这项工作,但这不是合适的方式。 Can anyone suggest how to make this work out to let service worker automatically tell my application that an update is available?
谁能建议如何解决这个问题,让服务人员自动告诉我的应用程序有可用更新?
You can send a push notification whenever there is a version change.只要有版本更改,您就可以发送推送通知。
Your service worker can detect and handle it accordingly您的服务人员可以检测并相应地处理它
https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.