G
G
gibigate2019-03-19 11:48:29
firebase
gibigate, 2019-03-19 11:48:29

How to update service worker?

Good afternoon, I'm trying to put push notifications on sites, the architecture is as follows:
Sites have files:

<script type="text/javascript" src="//www.gstatic.com/firebasejs/3.6.8/firebase.js"></script>
<script type="text/javascript" src="/firebase_subscribe.js"></script>
<script type="text/javascript" src="/firebase-messaging-sw.js"></script> /* зарегистрированный сервис воркер */

The firebase-messaging-sw.js file contains:
importScripts('https://example.com/api/js/sw.js?v='+(+new Date));

From which the main code of the service worker is loaded.
The question is simple, if there were changes in the file https://example.com/api/js/sw.js , how to tell the signed browser that did not visit the site to update the file?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question