227 points · by kayfloriven · 9y ago · 55 comments
Sure, some browsers will have a more robust experience in adverse network conditions, but the experience once a page has loaded will be identical. It's also difficult to accidentally make the worker a hard dependency of a site, since even supported browsers will load the site without the worker on first visit.
But seriously it is a bummer Safari doesn't support service workers yet. It's possible higher adoption would put more pressure on Apple to add support. In the meantime it can be a great enhancement where it is supported.
Apple has a vested interest in pushing users towards their walled garden for apps, while Google and Mozilla are trying to bring app-like experiences to the browser. There are hints of Safari supporting serviceworkers but I'm not holding my breath.
Highly recommend Alex Russel's talk on progressive web apps as background: https://m.youtube.com/watch?v=x7cfLDFVyHo
I happen to agree that offline-readiness (via service workers) is at the core of whether the open web will continue to be a relevant medium.
All browsers on iOS are wrappers around WKWebView (Safari, for the most part). You can’t release a browser app for iOS that doesn’t use this.
And desktop users of Chrome, Firefox, and soon Edge (which has support implemented behind a flag).
https://github.com/gdnmobilelab/hybrid
If you have an actual iOS app already, then this is of course worse, but if you have something that works nicely as a webpage on Android with ServiceWorkers and you want iOS users to have some option at all, this is probably worth playing with.
I really like that button. I don't know, it just drives home the point that you care that I understood your guide -- which was clear and easy to read.
* Cache css, js and images file
* Defined cached entries page ex index.html, show.html etc..
* Fallback Entries
and it is really simple to use. https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_...
- 100% static
- reasonable dataset size
- amenable url space (a few static files, then a large url
space that could fall back to serving out the index.html
file)
Despite this, the appcache just never worked reliably. It was a crapshoot whether it would actually work offline for any given user, I had to be careful not to permanently cache the appcache itself, and it was just generally inflexible and unpleasant.Also: https://alistapart.com/article/application-cache-is-a-douche...
I don't think this approach here should cost much performance. It is just a thread checking a cache (that will be on disk) on page load.
One of the more gnarly parts of ServiceWorker is having to clean up old caches during a version change. The workbox-build module generates revision hashes for your pre-cached assets and handles any cache clean ups for you.
https://github.com/fiatjaf/personal-graphs/blob/6182f5a40fec...
Damn it, if I'm going to have the song stuck in my head all day so should all of you!