3 ms·
I thought use of the Service Worker API was the primary feature defining a PWA. If it's a SPA and is able to be used offline, then it's a PWA. Also, lots of peo
by jnbiche 9y ago
I thought use of the Service Worker API was the primary feature defining a PWA. If it's a SPA and is able to be used offline, then it's a PWA. Also, lots of people then use Web App Install banners for PWAs.
- macns 9y agoSPA stands for Single Page Application: https://en.wikipedia.org/wiki/Single-page_application https://en.wikipedia.org/wiki/Single-page_application
- deleted 9y ago[deleted]
- bhalp1 9y agoGoogle says "If you're building a Progressive Web App, consider using a service worker so that your app can work offline." What does "consider" mean here? And I'm pretty sure SPA is also not a criteria for PWAs, it's just a suggestion. And also, the install banner is not really yours, it's the browser's functionality. Per Google: > Chrome uses a set of criteria and visit frequency heuristics to determine when to show the banner.
- bengotow 9y agoMy favorite part of the whole PWA marketing push is that they encourage use of the Service Worker API for offline caching, but leave cache invalidation / cleanup as an exercise to the reader. "Do it the way it makes sense for your application" is a technically correct answer, but I assume translates to "never" for 99% of us with tight deadlines.
- parthdesai 9y agoThis[0] might help you. [0]: https://workboxjs.org https://workboxjs.org
- holmberd 9y agoHaving a registered Service Worker is a condition of the app being classified as a Progressive Web App by Chrome.
- jnbiche 9y ago> And I'm pretty sure SPA is also not a criteria for PWAs, it's just a suggestion. Fair enough, you could certainly use Service Worker API for an app with multiple pages. What I was trying to capture with the term SPA is more "web app", although I suppose you could even use Service Worker API with a simple static site.
- squashmode 9y agoThat has sort of been my take on it as well. I have a SPA and have 'converted' it into a PWA. My motivation for that largely has been to better control the way assets are cached on the client, I can now control better with the service worker, but there is one really nice benefit: With the PWA, android devices (hopefully iPhone soon too) can 'install' the PWA to the device without going through Google Play Store (in fact, you can have the PWA install the android app available on Play Store instead, if you prefer). This makes the web-page appear to the user as an app, with a nice icon, and snappy performance relative to opening a link in chrome (even though it is a chrome instance running the 'installed PWA')