#DevoxxMA @_bruno_b_ Service workers Web app Cache Server Service Worker GET /api/stats GET /api/stats { “data”: [...] } { “data”: [...] } { “data”: [...] } Discussion on-going to cache POST requests https://github.com/w3c/ServiceWorker/issues/693 !
#DevoxxMA @_bruno_b_ Service workers Web app Cache Server Service Worker GET /api/stats { “data”: [...] } Caching strategies - caching falling back to the network - network falling back to the cache - cache first, then network - displays cache data until network response is returned - intercepts the network request and caches the response { “data”: [...] }
#DevoxxMA @_bruno_b_ In summary, PWA template includes... ● Manifest.json ○ makes the web app installable ● Service worker ○ By default, caches the application shell ○ Usable for any other resources: connectivity independence ● Preload/prefetch of app chunks for better performance ○ Preload : for resources that will be used in the page ○ Prefetch : for resources that might be needed
#DevoxxMA @_bruno_b_ Conclusion Still a lot to see: ● More technologies, such as Push notifications, Performance improvement, Server-side rendering ● Other boilerplates, such as nuxtjs/pwa ○ https://github.com/nuxt-community/pwa-template ● Good source to compare frameworks: HNPWA ○ https://hnpwa.com/ ● Case studies: ○ https://developers.google.com/web/showcase/