Writing a Service Worker
hacklabo.com
Writing a Service Worker
1–10 of 60 posts
Re: Writing a Service Worker
#2I imagine this comes with massive overheads in regards to data and ram usage, both of which are precious commodities on mobile platforms.
Re: Writing a Service Worker
#3Best use case of this I guess, is some kind of flight mode for web apps. Before going in to metro or flight, you click a button, and for example HN caches front page for you.
Re: Writing a Service Worker
#4I imagine this comes with massive overheads in regards to data and ram usage, both of which are precious commodities on mobile platforms.
At least when following this example the site should work just fine when JS is disabled, which was the main issue I had when I tried following google's (?) tutorial on how to use service workers to make webapps work offline. That one revamped the whole site into a JS app powered by service workers, with a blank white page remaining without JS. Not the case here.
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.
Re: Writing a Service Worker
#5No demo?
Re: Writing a Service Worker
#6Could this be used to optionally reduce bandwidth use? For instance, could someone use this before going into Airplane Mode, even though they are in the middle of a city, but do not want to use wireless data?
Re: Writing a Service Worker
#7Could this be used to optionally reduce bandwidth use? For instance, could someone use this before going into Airplane Mode, even though they are in the middle of a city, but do not want to use wireless data?
yes, a site could allow the user to preload data into the cache and prefer that later.
Re: Writing a Service Worker
#8Here's the simple service worker ever. It just caches some URLs and load them from the cache:
https://github.com/fiatjaf/personal-graphs/blob/6182f5a40fec...
Re: Writing a Service Worker
#9>This is, unfortunately, a familiar scene for everyone, whether you are in Tokyo, Milan or New York.
Damn it, if I'm going to have the song stuck in my head all day so should all of you!
Re: Writing a Service Worker
#10How large can the cache get at max?