Cache all pages #195
Replies: 1 comment
-
Sorry for not replying. I was on a break, so I didn't feel much like replying to questions :(
This is because when you use Vite, they output a HTML file that is used as an app shell. Well, the default Vite, anyway. Not so much about frameworks that use Vite though. VitePWA could precache this HTML file and your JS assets, allowing your SPA app to work perfectly offline. This is not the same for |
Beta Was this translation helpful? Give feedback.
-
Hello! I'm trying to migrate a small and simple PWA offline application from Vite + VitePWA to NextJS + Serwist. I only have 6 pages and all pages should open offline.
With Vite I have added all assets and pages to the cache this way:
After build the application and open the first page all assets and pages are cached. So when I take my browser offline, the current page and others continue to work normally.
I'm trying to do the same thing with Serwist, but I'm struggling.
My code:
sw.ts
next.config.mjs
What am I doing wrong? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions