Git Product home page Git Product logo

Comments (5)

bcardarella avatar bcardarella commented on June 8, 2024

you can tie your SW to a version or git commit to force it to expire. We use our package.json version value for dockyard.com

from ember-service-worker.

benoror avatar benoror commented on June 8, 2024

Thanks @bcardarella! I guess you mean manually triggering navigator.serviceWorker.register right? I can see doing this in different programmatic ways. We currently check for our latest git commit hash to prompt the user to refresh the page, I guess we can substitute refreshing for updating the SW... pretty straightforward 😄

Just wondering how do you handle it in dockyard.com using package.json version? Do you have a code snippet/service/addon?

Regards!

from ember-service-worker.

bcardarella avatar bcardarella commented on June 8, 2024

this addon has those strategies built in:

const EVERY_BUILD_STRATEGY = `self.CACHE_BUSTER = VERSION;`;
const PROJECT_REVISION_STRATEGY = `self.CACHE_BUSTER = PROJECT_REVISION;`;
const PROJECT_VERSION_STRATEGY = `self.CACHE_BUSTER = PROJECT_VERSION;`;

The strategy you want is the project version strategy.

from ember-service-worker.

benoror avatar benoror commented on June 8, 2024

@bcardarella awesome! We might consider versionStrategy: 'every-build' as well

Thanks!

from ember-service-worker.

bcardarella avatar bcardarella commented on June 8, 2024

👍

from ember-service-worker.

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.