PWA
Answered
German Shepherd Dog posted this in #help-forum
German Shepherd DogOP
I am pretty new to PWA's,
I have added a "manifest.json" to my application, but in order to get a full PWA I know I need to add way more than that.
Does next support everything out of the box? Or Do I need stuff like nextpwa to help me out with version control. offline caching ect. I do not expect to be spoonfed, but a push in the right direction would be nice:)
I have added a "manifest.json" to my application, but in order to get a full PWA I know I need to add way more than that.
Does next support everything out of the box? Or Do I need stuff like nextpwa to help me out with version control. offline caching ect. I do not expect to be spoonfed, but a push in the right direction would be nice:)
Answered by joulev
if you need offline caching you will need to write a service worker. nextjs doesnt do anything for you wrt service workers, but if you want to do it yourself you can just start writing a
that said, using something like serwist will make it significantly easier
public/sw.js
filethat said, using something like serwist will make it significantly easier
4 Replies
@German Shepherd Dog I am pretty new to PWA's,
I have added a "manifest.json" to my application, but in order to get a full PWA I know I need to add way more than that.
Does next support everything out of the box? Or Do I need stuff like nextpwa to help me out with version control. offline caching ect. I do not expect to be spoonfed, but a push in the right direction would be nice:)
if you need offline caching you will need to write a service worker. nextjs doesnt do anything for you wrt service workers, but if you want to do it yourself you can just start writing a
that said, using something like serwist will make it significantly easier
public/sw.js
filethat said, using something like serwist will make it significantly easier
Answer
@joulev if you need offline caching you will need to write a service worker. nextjs doesnt do anything for you wrt service workers, but if you want to do it yourself you can just start writing a `public/sw.js` file
that said, using something like serwist will make it significantly easier
German Shepherd DogOP
I'd assume serwist will also take care of the versions? So the app "updates" whenever changes are deployed?
@German Shepherd Dog I'd assume serwist will also take care of the versions? So the app "updates" whenever changes are deployed?
that is handled by caching, you should check serwist's documentation to see how it caches things. the default nextjs caching rules is [here](https://github.com/serwist/serwist/blob/0a0ba5c0c2e04431a23ac455097329a4a5147efd/packages/next/src/index.worker.ts#L16) but you can of course implement your own rules
@joulev that is handled by caching, you should check serwist's documentation to see how it caches things. the default nextjs caching rules is [here](<https://github.com/serwist/serwist/blob/0a0ba5c0c2e04431a23ac455097329a4a5147efd/packages/next/src/index.worker.ts#L16>) but you can of course implement your own rules
German Shepherd DogOP
Alright, I'll check it out deeper in a sec, on first glance it does look easier to implement thank you!