5 ms·
Please. Please don't do this. Service workers cause so many problems, I have never seen an implementation that didn't completely explode at some time or another
by mdoms 6y ago
Please. Please don't do this. Service workers cause so many problems, I have never seen an implementation that didn't completely explode at some time or another, and as far as I can tell the only fix is to open the dev tools and delete service workers. They're a bad solution to a non-problem.
- aitchnyu 6y agoClearing browser cache used to be our "have you turned it off and on again?" Looks like we need a "restore website to factory settings" which clears cache, cookies, service workers, offline storage, JIT of the code etc.
- inglor 6y agoThere are many use cases for service workers you probably haven't heard of. For example at my last job (at a YC startup) we built a service worker that used P2P to serve mp4 video over WebRTC. It was the correct place to interop with the download - it was explicit and it would have been impossible without it. ---- I think the common use case (of much control over caching) is also quite reasonable. I agree the API and usage is too hard.
- fxtentacle 6y ago"it would have been impossible without it" C++ desktop app It'll even have 2x the throughput at the same CPU level. Plus users can choose when they want to run your app, as opposed to you accidentally draining their battery because they left an old tab open. Boom, possible and better :p
- SirHound 6y agoBetter = higher barrier to entry?
- fxtentacle 6y agoLess behavior that users are surprised by in a negative way.
- srtjstjsj 6y agoExcept for the remote code execution.
- jakelazaroff 6y ago"Better" is subjective. Web apps sacrifice performance, but you get an app that you don't have to install, that can't do anything malicious to your system without your consent, that's (at least in theory) easily shareable and deep linkable. Maybe that tradeoff isn't worth it for you, but it is for a lot of people!
- corytheboyd 6y agoYeah this is the point right here that seems to be so easily forgotten. You lost every non-programmer at “okay download this binary and run it from the terminal with these flags”
- Santosh83 6y agoNot really. Non-programmers have also been using computers ever since the PC revolution and are quite used to downloading, installing and running programs, provided it has a usable GUI. After all, web apps are very recent. Even now, most programs are installed, and the rest are websites.
- jakelazaroff 6y agoWeb apps are relatively recent, sure. But the web is three decades old at this point. The majority of people using computers today grew up with web apps being a thing. It's difficult to verify, but my guess is your stats are backward: most programs are websites, and the rest are installed.
- the_gipsy 6y agoTwitter's implementation just exploded on me the other day on my phone. Since then I cannot open ANY links to twitter anymore. I just get a page from the browser that says "Cannot complete request". It's on my phone so I can't just clear a single site's data, and I cannot be bothered to clear everything and relog everywhere.
- dntrkv 6y agoHook up your iPhone to your Mac via lightning cable. Open Twitter on your iPhone and then on your Mac open Safari, enable develop mode, and then go to Develop > Your iPhone > Twitter tab. This will open up inspector on your Mac allowing you access to the local Twitter data on your iPhone. I think that should work.
- the_gipsy 6y agoI have a pixel and a thinkpad, but yea I've considered that. But I also realized that now I'm wasting a little bit less time on my phone :) I also am intrigued if there is a way for twitter to fix this on their end, somehow, sometime.
- cjstadler 6y agoAre you on Firefox? This resolved it for me: https://support.mozilla.org/en-US/kb/twitter-isnt-working-firefox https://support.mozilla.org/en-US/kb/twitter-isnt-working-fi...
- the_gipsy 6y agoYes but mobile.
- kreetx 6y agoThe problem might be that it's just not well understood yet, it definitely has it's use cases. That said, I recently tried Twitter's PWA and it went into an infinite page refresh loop right after login. So yeah, not easy to get it right.
- jupp0r 6y agoHave you used the internet lately? Service Workers are ubiquitous. Google.com is using them. Amazon.com is using them. Your uncles blog is probably using them too. Sure they can be tricky, but don't dismiss their success.
- tziki 6y agoFirst, I think service workers are essential if we don't want all future apps to live and die by arbitrary app store restrictions. Service workers provide a lot of functionality that make web pages competitive (feature-wise) with apps. Second, I'm sure you've seen plenty of implementations that were just fine, you just didn't notice. Angular comes with a default implementation that does caching and plenty of sites use it.
- haywirez 6y agoYou can send a Clear-Site-Data header[1] for forcing a full refresh. [1] https://w3c.github.io/webappsec-clear-site-data/#header https://w3c.github.io/webappsec-clear-site-data/#header