progressive-web-apps - Gatsby PWA How to handle updates?
问题描述
I am using the gatsby-plugin-offline
plugin and would like to know if there is a way to handle updates.
I would like to display a message if a new version is available like https://medium.com/progressive-web-apps/pwa-create-a-new-update-available-notification-using-service-workers-18be9168d717
At the moment I need to hard reload the site in order to see changes.
How to handle this?
解决方案
是的,有一种方法可以做到这一点,Gatsby v2 支持onServiceWorkerUpdateFound
,gatsby-browser.js
查看更多详细信息:https ://github.com/gatsbyjs/gatsby/issues/9087#issuecomment-429853664
推荐阅读
- json - 试图再次打羊
- android - 是否可以在 AndroidStudio 中使用 nidi.guru Graphviz 实现?
- android - Amazon Pinpoint 和 Ionic - 当应用程序处于后台时,推送通知不起作用
- excel - 如果满足条件,则添加条件的 Excel Sumifs
- python - 如何上传和比较列表?
- c# - MVVM 从 TabControl 绑定到 Page.DataContext
- javascript - 在子transitionend上触发Transitionend
- python - Keras 批量标准化 - 什么轴?
- php - 从给定的mysql结果中获取月数
- actionscript-3 - 我正在尝试让一个 MovieClip 跟随另一个 MovieClip 直到联系。一个影片剪辑按加速度计移动