Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect a PWA to a new server

I have an app that registers service worker to make the app available offline. Now I need to move the app to a new server, so I set up a 301 redirect for the root page. But existing caches seem to ignore this and always serve the old app on the old URL. How do I force them to update?

like image 983
riv Avatar asked Aug 02 '19 15:08

riv


1 Answers

Another simple way to do that is by using workbox-window. you can detect new service workers installation and prompt user to reload the page or reload it without user permission. for more detail please read this.

I hope this can help you.

like image 120
Ali SabziNezhad Avatar answered Oct 09 '22 11:10

Ali SabziNezhad