I feel like a service worker is really overcomplicated / overkill for a small blog, especially with proper caching used on articles and resources.
Good caching rules are enough to let an offline user access an article he visited, Firefox is pretty neat for that, and that doesn't force to re-code an entire caching logic.
You're totally right. But kudos to the author for explaining what offline should be. Many PWAs I've used (including this site) simply display a "You're offline" message when I'm offline.
Somehow, even though this is pretty neat, it just feels like a tool websites will abuse to dump tons of their website cache onto my device whenever I visit, you know "just in case" there is a service interruption.
I can hear the CEO conversation now....."hey, this is great, if someone comes to our site, we can cache every single article because why wouldn't people spend the next two hours reading everything we have! Pre-cache all the things!"
Tools like this need to be used carefully, and developers shouldn't make assumptions about what users will or won't do on their sites. I definitely don't want web workers pre-caching random other pages and content without knowing I have any intention of visiting those. At best, I just don't want my current open page to die. But that's about it.
Do you have a full working example of this?
Great article man! Saved it for a second read and sharing it with my pals!
ohh now I understand why I need an offline page. Thanks a lot
A great article covering all aspects of service worker. Thank you
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.