add PWA support with caching#23
add PWA support with caching#23sgametrio wants to merge 2 commits intoquasarframework:masterfrom sgametrio:master
Conversation
template/build/webpack.prod.conf.js
Outdated
|
|
||
| runtimeCaching: [{ | ||
| urlPattern: /\/.*/, | ||
| handler: 'networkFirst' |
There was a problem hiding this comment.
Why did you choose networkFirst? I would prefer using the cached copies first, then refetching the changed files and using them on the next reload. If I understand correctly networkFirst would refetch the unchanged files on all refresh which would be suboptimal on mobile internet, right?
There was a problem hiding this comment.
I think you're right, cache-first approach seems to be very nice on mobile. The problem is that this configuration has to be changed based on projects. There is no configuration that fits well on every project, some needs network-first, some need fastest, depending always on what resources are we caching. Thanks though for the tip. Let's talk again after v0.14
|
Hi, thank you for this PR. Can we schedule a talk after the v0.14 release? Currently on a very tight schedule to release the new version, but after that it's time for some new starter kits, and a PWA one is scheduled too. The PWA needs to be another repo entirely as it doesn't makes sense to add this to the default template which can be wrapped by Cordova or Electron too. So a talk after v0.14? |
|
Sure man. |
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
devbranch and not themasterbranchfix: #xxx[,#xxx], where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
Add initial PWA support with sw-precache caching of js and css files. In production (only on HTTPS) instantiate a service worker, so the browser can ask you if you want install your app without doing any additional step. The service worker part could be done better but I want to give instant support to ones who want to use PWA in their entirety. Let me know if something isn't working or if I did an hole in the water ;)