sw-toolbox

Service Worker skipWaiting unable to activate currently waiting SW

て烟熏妆下的殇ゞ 提交于 2019-12-10 17:46:42
问题 Description: We are using sw precache for caching the scripts before hand, hence to update the scripts we are giving reload option, for that we are listening the worker message to skip waiting the newly install service worker for unknown reason we are not getting correct importScript // GETTING OLD SW reference (self) and NOT getting newly installed SW reference self.addEventListener('message', function(event) { *// not working* self.skipWaiting(); }); // But if we put skipWaiting() in

How to cache bust sw-toolbox?

不打扰是莪最后的温柔 提交于 2019-12-01 18:47:36
问题 I have been toying around with service workers and sw-toolbox. Both are great methods but seems to have their weaknesses. My project started out using Google's method of service workers (link). The way I see this is that you have to manually update the version number for cache busting. I could be wrong also but I don't think the pages that the users has visited will not be cached. Compared to the sw-toolbox method, all I need to add is the following code: self.toolbox.router.default = self

How to cache bust sw-toolbox?

谁说胖子不能爱 提交于 2019-12-01 18:13:06
I have been toying around with service workers and sw-toolbox. Both are great methods but seems to have their weaknesses. My project started out using Google's method of service workers ( link ). The way I see this is that you have to manually update the version number for cache busting. I could be wrong also but I don't think the pages that the users has visited will not be cached. Compared to the sw-toolbox method, all I need to add is the following code: self.toolbox.router.default = self.toolbox.networkFirst; self.toolbox.router.get('/(.*)', function (req, vals, opts) { return self.toolbox