• Resolved axmann

    (@axmann)


    Hi Magazine3,

    I’d like to achive that users don’t need to reinstall their PWA after I’ve made some changes like switching start url or adding a new icon. An automatic update function so to speak. Is there a way to do that?

    If I understand your plugins behavior right, reinstalling is the only way to get such changes on the mobile. I’ve tried it with cleared browser cache, severel caching strategies, a super short cache expire and “force update service worker” option but no success. Or am I missing something?

    From a customers point of view it would be a better user experience because many of them probably won’t understand why they have to delete their app first to get an update. Not to mention people -especially older ones- who aren’t quite familiar with (un)installing.

    Hopefully I could make my topic clear.

    Kind regards
    axmann

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Magazine3

    (@magazine3)

    Yes, you can use the “force update service worker”. it will take some time. because when you navigate on site then only it will try to grab a new service worker.

    There will be a point in time where your service worker will need updating. When that time comes, you’ll need to follow these steps:

      Update your service worker JavaScript file. When the user navigates to your site, the browser tries to redownload the script file that defined the service worker in the background. If there is even a byte’s difference in the service worker file compared to what it currently has, it considers it new.
      Your new service worker will be started and the install event will be fired.
      At this point, the old service worker is still controlling the current pages so the new service worker will enter a waiting state.
      When the currently open pages of your site are closed, the old service worker will be killed and the new service worker will take control.
      Once your new service worker takes control, it activates new cache will be serve.
    Thread Starter axmann

    (@axmann)

    Thanks for your reply and your detailed explanation. If I understand you right the service worker isn’t affected by settings like “cached time” or “caching strategies”.

    Just to make things clear two more questions:

    – Does the time vary untill a new service worker is grabbed?

    – When do you actual recommend using “force update service worker” (e.g. after setting up a new icon or startpage)?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to update manifest and service worker without reinstalling’ is closed to new replies.