Coder Social home page Coder Social logo

Comments (2)

jeffposnick avatar jeffposnick commented on July 27, 2024 1

The service worker name isn't customizable, as it's one of the options that are used in the configuration from the main c-r-a project. Without being able to customize the configuration, you can't change the name.

If you have a previously deployed service worker with a different URL, and want to transition to the new service worker URL, you should take the following two steps:

  • Create and deploy a "kill switch" service worker with your old URL.
  • Deploy your new service worker and ensure that the URL you use for service worker registration corresponds to the new URL.

If you follow both those steps, then both repeat visitors and new visitors will (eventually) end up with the correct service worker with the new URL. It can take two navigation requests for repeat visitors to get the complete update, as the first navigation request will result in the "kill switch" service worker being installed, and the second navigation request will result in the new service worker being installed.

from pwa.

haggen avatar haggen commented on July 27, 2024

@jeffposnick Thank you for the thoughtful answer! I ended up making a rewrite from /sw.js to /service-worker.js and using the unregister() call. In my case PWA wasn't really worth the trouble.

from pwa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.