[special]In this article, we'll go through the basics of what a progressive web app (PWA) is, study some real life cases, and explore other uses and situations in which a PWA can be used to great effect.[/special]
Nowadays, significant numbers of people are connected to the internet almost everywhere they go. There are, however, still an even larger number of users with intermittent access, such as users on mobile data plans, shared internet access and so on. Catering to these users requires changes to the information flow we're used to.
By allowing users to keep browsing once they're offline, serving the pages they've already visited, it's possible to retain visitors and customers who would otherwise be in the dark once their internet is cut off.
It's even possible to use the cached data and program functions for that, allowing for interactivity similar to mobile applications, but without the need for the user to download an app via the various app stores, and similarly, without the need for submitting to them as well.
What is a Progressive Web App?
When trying to understand what exactly a progressive web app is, it might be easiest to compare relative to both websites and mobile applications. In the table below, some, not all, of the more prominent features are sidelined with PWAs in the middle, symbolizing the gap-bridging functionality of the progressive web apps.
Features |
Website |
Progressive Web App |
Mobile App |
Offline |
NO |
YES |
YES |
App Stores |
NO |
NO |
YES |
Responsive |
YES |
YES |
YES |
Searchable |
YES |
YES |
NO |
Local notifications |
NO |
YES |
YES |
Push notifications |
NO |
YES |
YES |
Download to install |
NO |
NO |
YES |
Fast updates |
YES |
YES |
NO |
Keep in mind that the entire term "progressive web app" loosely contains a number of relevant and some irrelevant information and criteria. Technically, there are four requirements (see below) that define what a PWA is, currently supported by Google Chrome, Opera and Samsung Internet.
Once these four criteria are fulfilled, developers are free to customize the functionality according to their own wishes, so we can see both offline error pages, and full-on offline browsing depending on what project and site we're visiting.
Becoming Progressive
In order for any online site to be recognized as having a progressive web app installed on the server --- and thus include the prompt “Add To Home Screen” for users --- there are four main requirements as set out by Google:
- a site must be visited twice with a 5-minute interval to qualify
- secure HTTPS connection Valid
- JSON Manifest installed Valid
- Service Worker installed.
Site must be visited twice with a 5-minute interval to qualify
In Google Chrome, it's necessary for users to have visited the site hosting the PWA twice before the browser will show the prompt for installing the PWA.
It's not the most reliable form of verification, but nonetheless, it seems to work fine, as first-time visitors won’t get bombarded with the prompt taking up 25% of a mobile screen, and furthermore, it ensures that users are somewhat interested in that particular site, seeing as how they’ve already visited it before.
However, this is a simple way of determining user relevance and interest, and one could guess that this qualification parameter will be changed to something more substantial in the future. But for now, it seems Google developers are content with this measurement.
Secure HTTPS connection
By having a secure connection to the progressive web app, users can feel relatively safe by allowing permissions to the PWA.
Since the network requests are routed through the service worker script, adding https
to the server helps to mitigate certain vulnerabilities such as snooping.
While this requirement might be focused mainly on adding safety from hijackers, having a secure connection also helps build trust with users. And since PWAs are indexable by search engines, it also makes sense to serve over TLS, since it adds a small amount of benefit SEO-wise.
Valid JSON Manifest installed
By providing a data extract in the format of JSON, it's then possible to cache this information with the help of the service worker, and then use the app shell to load CSS rules to deliver an offline version with full UI capabilities.
Any time a visitor loads a new page, the service worker will cache the JSON extract, and store it physically in the app shell. This app shell is a self-contained wrapper that has all necessary style sheets, scripts, images, fonts and HTML outputs required for a user to render a complete page without loading anything else.
Compared to a website, a PWA has the capability of still showing data when the users are no longer connected to the internet.
Continue reading %Progressive Web Apps: Bridging the Gap Between Web and Mobile%
by Mark Pedersen via SitePoint