简体   繁体   English

以受控方式更新 Angular PWA:问题

[英]Updating an Angular PWA in a controlled manner: Questions

I've been playing around with angular's PWA.我一直在玩 angular 的 PWA。 I got everything running as I wanted, but I still have some unanswered questions:我让一切都按照我的意愿运行,但我还有一些悬而未决的问题:

  • The swUpdate.available observable randomly fires twice (at once). swUpdate.available observable 随机触发两次(一次)。 How come?怎么来的?
  • What if I prompt the user with a dialog when an update is available, but he declines - will swUpdate.available ever fire again?如果我在更新可用时通过对话框提示用户,但他拒绝了 - swUpdate.available 会再次触发吗?
  • Calling swUpdate.checkForUpdate() sometimes takes under 100ms, and sometimes a really long time (+90sec).调用 swUpdate.checkForUpdate() 有时需要不到 100 毫秒,有时需要很长时间(+90 秒)。 What can be the cause?可能是什么原因?
  • Finally, when opening my app (with PWA) the first time, the initial load often takes a long time (+10 sec), although I am using registrationStrategy: 'registerImmediately'.最后,当第一次打开我的应用程序(使用 PWA)时,初始加载通常需要很长时间(+10 秒),尽管我使用的是registrationStrategy:'registerImmediately'。

I find the swUpdate API to be a bit archaic.我发现 swUpdate API 有点过时。 Why does checkForUpdate() not return an Observable with the UpdateAvailableEvent if there is any?为什么 checkForUpdate() 不返回带有 UpdateAvailableEvent 的 Observable(如果有的话)? ♂️ ♂️

Cheers干杯

As I could not fix this problem, I switched to Workbox由于无法解决此问题,我切换到Workbox

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM