Use electron with service worker to save/pre-load remote content


#1

I built an offline electron app. Everything works fine, but I want to be able to able to push out updates to my app.

Currently, all resources are loaded locally. I want to load all JS/CSS/HTML files from a remote web server and use service worker to handle the caching. However, when I install a service worker it gets scoped to the folder of the packaged exe and is unable to intercept fetch request from remote hosts.

Using service worker I was able to pre-cache everything I needed from a web server but unable to serve them from the cache.

Has anyone done something similar and be willing to offer some help :slight_smile: .