DEV Community

Discussion on: Adding a PWA in Nuxt.js

Collapse
 
mornir profile image
Jérôme Pott • Edited

Thanks for the quick guide.

I encourage web developers to first consider whether a PWA really makes sense for the website they're building. Is there a real benefit to install it? Is it performant? Does it really work offline? The problem with most PWAs is that they fall back to the cache when the user is completely offline, but not on a flaky network or on lie-fie.

If you deem that a PWA will bring an added value, then please think carefully about the best time for showing the install banner. For example, after a purchase (here more about this topic: web.dev/promote-install/). You can save the native install prompt and show it when you see it fit.

Personally I hate PWA install banners popping up the first time I visit a website. At this rate, there will be a global setting to block them as it's currently the case for push notifications.

So yes, it's indeed easy to install that module, but it's much harder to have a PWA that truly behaves like a native app. Also, developers should take the time to examine the different caching strategies and then choose the most appropriate one for their websites. The Nuxt PWA module is based on the excellent Workbox library and you can customize the module to your needs. Don't hesitate to read the Workbox docs.

Collapse
 
debs_obrien profile image
Debbie O'Brien

Thanks for your comments. Yes I agree. I never install anything which is why I only use a PWA for better performance and it does work great especially for some sites when you are in airplane mode but can still access the site and read articles etc. So yes it does work offline if you have first connected online and it is therefore in your cache. Google recommends creating a PWA for better performance and as I generally encourage good performance I would personally recommend installing a PWA. How far you take that PWA into the native world and how many push notifications you create is another story. Personally I just use the basics for performance and nothing else though I am sure having some push notifications could bring some added benefit.