I've a simple single page application written in just html/css/js. The content of the page is hard coded into the index.html
file. I have a service worker so that the webpage can be downloaded and viewed as an app on a mobile device. I am trying to work out how is best to make sure any updates to the index.html file are reflected in the app version that is downloaded. From what I understand, if the user never closes the app, the updates would not appear on the app. Only after closing the app and then reopening it would the updated content be available. Is there a way to force the PWA to update its content even if the app is left open on a mobile device? Or a way to send a notification that an update is available?
Add a comment
|
1 Answer
Ajax technology must be used on your pages. The key to solving the puzzle is that Ajax loads the data in the background by using JavaScript and XML, so your page never needs to be refreshed. There is no code to change, so the answer is very general.