简体   繁体   English

Angular service worker 未指定间隔自动运行

[英]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.

相关问题 向容器注册的 Angular 服务未指定“providedIn” - Angular service registered with container without specifying "providedIn" Angular service worker 不在系统 IP 地址上运行 - Angular service worker not running on system IP address 带webpack的Angular服务工作者(不带CLI) - Angular service worker with webpack (without CLI) Angular 9 PWA:Service Worker / Manifest scope 在子目录中运行应用程序和托管在不同子目录中的服务工作者时出现问题 - Angular 9 PWA: Service Worker / Manifest scope issues when running app in subdirectory and service worker hosted in a different subdirectory Angular HttpClient“未知错误”与服务工作者和长时间运行的请求 - Angular HttpClient "Unknown Error" with service worker and long-running request Angular 5 中的 Service Worker - Service Worker in Angular 5 Angular 7 - service worker 未注册 - Angular 7 - service worker not registered Angular:服务工作者配置 - Angular : service worker configuration Firebase 服务人员和 Angular - Firebase service worker and Angular Angular Service worker (ngsw-worker.js) 在运行构建命令后未在“/dist”文件夹中生成 - Angular Service worker (ngsw-worker.js) is not generated in the "/dist" folder after running build command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM