Questions tagged [sw-toolbox]
39 questions
14
votes
5 answers
How to update service worker cache in PWA?
I use service worker with sw-toolbox library. My PWA caches everything except API queries (images, css, js, html). But what if some files will be changed someday. Or what if service-worker.js will be changed.
How application should know about…

Ildar
- 3,808
- 7
- 45
- 81
5
votes
2 answers
Service Worker skipWaiting unable to activate currently waiting SW
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…

Anurag Singh
- 727
- 6
- 10
- 27
5
votes
2 answers
How to cache bust sw-toolbox?
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…

oninross
- 989
- 6
- 23
5
votes
1 answer
Does sw-precache activation of new service worker guarantees cache busting?
I am using sw-precache along with sw-toolbox to allow offline browsing of cached pages of an Angular app.
The app is served through a node express server.
One problem we ran into is that the index.html sometimes doesn't seem to be updated in the…

mkhatib
- 5,089
- 2
- 26
- 35
4
votes
1 answer
Problems cache busting serviceworker index.html file
I'm using Google's SW Precache to generate the serviceworker for an Angular (currently v.4) app hosted on firebase. I'm using Angular cli to generate my distributed files. When it comes time to deploy my app, I use the following commands:
ng build…

jloosli
- 2,461
- 2
- 22
- 34
4
votes
2 answers
Handling Google analytics in an offline enabled web app
I am a developer of Codiva - java ide and online compiler. I am working on improving offline support, reducing network usage, reducing the latency by pre-caching as much as possible.
I want to know how to handle requests to google analytics.
First…

JackDaniels
- 985
- 9
- 26
2
votes
2 answers
Bypass Service-Worker caching
I have a progressive web-app, which speaks to an API. The calls to this api get cached by a service worker, which works great.
But now, I want to add a reload-button, which ideally forces the service worker to try to bypass the cache and update it…

Leander
- 1,322
- 4
- 16
- 31
2
votes
0 answers
cache api data using sw-toolbox
I am using sw-toolbox to cache all the resources. However, I am not able to figure out how to cache api response data. I could use indexDb or internal storage for the same. Just curious to know, can I just cache it using service worker?
I tried…

scripter
- 1,416
- 4
- 19
- 35
2
votes
0 answers
maxAgeSeconds in sw-toolbox not working
I'm using sw-toolbox for building progressive web app. All resources are getting cached as expected but they are not expiring on putting maxAgeSeconds.
toolbox.router.get("/test/(.*)", toolbox.cacheFirst, {
cache: {
maxEntries: 5, name:…

Vivek Pratap Singh
- 9,326
- 5
- 21
- 34
2
votes
2 answers
Using sw-toolbox with gulp
I read many tutorials about sw-toolbox and sw-precache.
The doubt i am having is :
When reading about sw-precache, i found out most tutorials are using gulp + sw-precache.
Whereas in sw-toolbox case, i saw the example and syntaxes given only for…

Shashank Sood
- 480
- 5
- 16
1
vote
2 answers
WorkboxSW constructor throws error Undefined
In my service worker file, I am using this code:
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.0.0-beta.2/workbox-sw.js");
const workbox = new WorkboxSW();
But I am getting error Uncaught ReferenceError: WorkboxSW is not…

Amit Singh
- 1,790
- 3
- 17
- 27
1
vote
0 answers
ASP.Net /IIS CORS Access-Control-Allow-Origin:* not working for all requests
I have enabled CORS by adding below to webconfig but it doesnt seems to work consistently:

Naveed Ahmed
- 10,048
- 12
- 46
- 85
1
vote
1 answer
sw precache - runtime caching for assets loading from different domain
I am using sw precache to manage my service worker. Let us say my site is abc.com and the service worker is running on this site and loaded by url abc.com/service-worker.js
All the css and js are being loaded from different url for optimization…

Gurmeet Singh
- 774
- 8
- 21
1
vote
2 answers
sw-toolbox not working on gh-pages
I made a simple AngularJS to-do app and used sw-toolbox. It is working fine on my localhost but when I am using it on gh-pages, few 404 errors are thrown on console and service worker is also showing 404 error while fetching scripts.
DEMO
CODE

Vivek Sharma
- 41
- 4
1
vote
2 answers
Using sw-precache configured with runtimeCaching is not loading sw-toolbox
According to the sw-precache documentation https://github.com/GoogleChrome/sw-precache#runtime-caching including configuration for runtime caching for sw-precache should itself take care of including sw-toolbox for runtime caching of dynamic…

blissedout
- 11
- 3