Flint Studios
Gary Henderson

Gary Henderson - 16 March 2016

Gary Henderson
16 March 2016

Coming to a Browser near you……

So what are Progressive Web Apps? 
Progressive web apps are basically web pages that have been built so that a device (normally a phone or tablet) can keep a version in their own memory and on their home screens. 

1.    The progressive bit is a design tenet that means they will have progressively more functionality on better/newer browsers. 
2.    They will be responsive, reformat their layout depending on screen size/orientation.  
3.    They will look and feel like a native application. 
4.    They will be discoverable – like Web services the page will publish its capabilities.
5.    Linkable – they are after all basic web pages, with additional functionality.

They talk to the web server through a worker service (see below). The user is either invited or has the option to install the Web App after visiting the same page a number of times. This is a mechanism to try and stop spammer type apps just installing on the first visit, the browser decides that this page has been visited X times in the last Y days so must be a favourite and offers to install it as an app.

The main key to Progressive Web Apps are the Service Workers – this is a new standard (or rather an extension to an existing one) that is being proposed and is basically an AJAX service for that one app.

Service Workers

Service workers are like programmable proxies for the web app; basically they run in the background intercepting network requests from the app, then issues a “fetch request” to the web site/service. When a response is returned it the caches that response and issues a “Notification Event” to the app. Any “Push Event” from the web site/service can also force a Notification Event to be generated.

A service worker cannot access the DOM directly, they can access indexedDB and the app cache. The app is not aware that the service worker is sitting in between it and the site/service. The benefit is that the worker can issue a response using cached data from either cache or DB if the connectivity has been lost; this results not only in the app never failing to get a response, but also faster startup times as the initial response is being made locally, once the app is up and running the worker can go to the site/service and update the stored data.

The service worker runs for a limited time, coming awake when either a network request from its App is intercepted, or a push notification from the web server arrives. It will then process that request/notification, wait for another for a short period. If none are forth coming it will fall asleep again, being shifted out of memory by the OS when need be.


What it means for the end user

It will mean that your favourite sites will sit on you home screen, and will be constantly updated when a connection is available. You will always have the latest obtainable information. Think Windows 8/10 live tiles only for your favourite sites. These could be news sites showing the latest headlines, surf reports directly to your home screen, anything that you frequently check for updated information. It will make it so simple for developers to build web apps that there will be no reason that every web site should not have one.

This along with WebAssembly (we will hopefully have a tech post about this soon) will see a major step change in mobile application development.

Links for more information...
Progressive apps escaping tabs without losing our soul
Google progressive web apps new scheme for native like web apps

Copied!