-
Hi all, We're looking to setup our app as a PWA, mainly because we need some offline capabilities. I know this is a little vague of a question and probably comes down to project specifics, but, I wondered if anyone had any insight on how next-pwa and next-offline stack up against each other? Is there another best practice alternative? Just wondering if there's a bit of a consensus surrounding serving content offline with Next. Thanks so much for your help 🤙 |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 8 replies
-
Cheeky bump 😬 |
Beta Was this translation helpful? Give feedback.
-
I went with |
Beta Was this translation helpful? Give feedback.
-
We are using next-offline and it is working well with a custom config. Haven't used next-pwa although but the runtime strategy looks very promising that is ideal for most web applications like NetworkFirst for /api/ and staleWhileRevalidate strategy for fonts and images, etc. Next-offline in general implements caching for every resource with I would say at the end you should always have your own strategies and patterns to cache resources which next-pwa is great at doing. If I had to use next-pwa, I would still go about having a strategy that only caches resources from my origin because it fits well to my personal use-case and caching everything is not ideal. |
Beta Was this translation helpful? Give feedback.
-
next-offline vs next-pwa: next-pwa “is more opinionated (with presets of workbox configurations) and aims to be as simple as possible for users.” according to the author himself. next-offline is "more mature", based on having existed 2 years longer (since 2018), according to npmtrends.com. next-offline is more popular, but both are rising, and next-pwa is rising faster:
Bundle sizes (min & gzip) for both are quite large (potentially prohibitively so, imho):
If you are using Expo Web, then next-offline is the one they refer to in the expo web docs, so it seems a safer bet in that case. |
Beta Was this translation helpful? Give feedback.
-
Beside all the answers, i prefer using next-pwa for this particular reason:
|
Beta Was this translation helpful? Give feedback.
-
Hello everyone, I am trying to create a PWA using next js with offline support without any libraries My PWA is installable and works well however when I want to cache resources, I have an issue. My app is working well offline if I put a "offline.html" file in my /public folder. Am I missing something here? |
Beta Was this translation helpful? Give feedback.
-
Hey everyone. We now have updated documentation on building PWAs with Next.js. https://nextjs.org/docs/app/building-your-application/configuring/progressive-web-apps |
Beta Was this translation helpful? Give feedback.
Hey everyone. We now have updated documentation on building PWAs with Next.js.
https://nextjs.org/docs/app/building-your-application/configuring/progressive-web-apps