Skip to content

Progressive web application of dicom viewer

milung edited this page Sep 4, 2017 · 2 revisions

Progressive web application of dicom viewer

Application Dicom viewer is a progressive web application so it can be fully used offline.

Result of audit by lighthouse.

result.jpg

PWA is implemented by a service worker, implemented in file src/service-worker.js. This file contains functions activate, fetch and install, which provide services for storing the application shell and static assets to cache. It fulfills all the aspects of progressive web app defined by lighthouse audit, except for fast loading on 3G.

Add to homescreen test

Application was tested on Android devices and it worked as expected. It can be added to home screen and fully used as a mobile application even without internet connection.

Issues

Errors in console

Application is working offline and online, but there are some errors logged in browser console.

With application set to Offline, we can refresh the page and continue to see site content, even though nothing is coming from the network. After switching to the Network panel we can notice in the size column that resources are coming from Service Worker. That's the signal that tells us the Service Worker intercepted the request, and served a response from the cache instead of hitting the network (retrieved from https://codelabs.developers.google.com/codelabs/debugging-service-workers/index.html#4).

image.png

You may notice there are failed requests (like for a new service-worker.js). That's totally fine and expected (retrieved from https://codelabs.developers.google.com/codelabs/debugging-service-workers/index.html#4).

Clone this wiki locally