NextJs Offline Mode?
Unanswered
Ejayz || PiggyDev posted this in #help-forum
His is it possible to do offline mode with nextjs ? My idea would be doing offline mode then if internet comes back online it would automaticvally save data in database
6 Replies
American Chinchilla
Definitely--I've done this before with a hook that listens for online/offline events. If you're changing pages though it's probably a bit trickier...
Western paper wasp
Any JavaScript that’s already loaded and executing on the current page will continue to work offline! But navigations between pages usually requires a round-trip to the server; afaik Next doesn’t have a mode that supports offline routing because most other routes aren’t preloaded
I see . welp i guess imma stand for react native plus offline db the next js as api
@Ejayz || PiggyDev His is it possible to do offline mode with nextjs ? My idea would be doing offline mode then if internet comes back online it would automaticvally save data in database
if you meant a PWA that can work offline, check serwist
yea something like that . If no internet user can still do operations based on data that is available on local db . then just merge it on online db if internet is back .
also thinking of putting it in web view on mobile app