首页 > 解决方案 > 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?

标签: progressive-web-appsgatsby

解决方案


是的,有一种方法可以做到这一点,Gatsby v2 支持onServiceWorkerUpdateFoundgatsby-browser.js查看更多详细信息:https ://github.com/gatsbyjs/gatsby/issues/9087#issuecomment-429853664


推荐阅读