Progressive Web Apps. Ah yes, those things that Google would have you believe are a combination of Gandhi and Dumbledore, come to save the world from the terror that is the Painfully Slow WebsiteTM.
But what actually makes a PWA? Should you have one? And if you create one, how will you make sure it ranks? Well, read on to find out...
What's a PWA?
Given as that Google came up with the term, I thought we'd kick off with their definition:
"A Progressive Web App uses modern web capabilities to deliver an app-like user experience."
– Progressive Web Apps
The really exciting thing about PWAs: they could make app development less necessary. Your mobile website becomes your app. Speaking to some of my colleagues at Builtvisible, this seemed to be a point of interesting discussion: do brands need an app and a website, or a PWA?
Fleshing this out a little, this means we'd expect things like push notifications, background sync, the site/app working offline, having a certain look/design to feel like a native application, and being able to be set on the device home screen.
These are things we traditionally haven't had available to us on the web. But thanks to new browsers supporting more and more of the HTML5 spec and advances in JavaScript, we can start to create some of this functionality. On the whole, Progressive Web Apps are:
Source: Your First Progressive Web App (Google)
- Progressive
- Work for every user, regardless of browser choice because they're built with progressive enhancement as a core tenet.
- Responsive
- Fit any form factor: desktop, mobile, tablet, or whatever is next.
- Connectivity independent
- Enhanced with service workers to work offline or on low quality networks.
- App-like
- Feel like an app to the user with app-style interactions and navigation because they're built on the app shell model.
- Fresh
- Always up-to-date thanks to the service worker update process.
- Safe
- Served via HTTPS to prevent snooping and ensure content hasn't been tampered with.
- Discoverable
- Are identifiable as "applications" thanks to W3C manifests and service worker registration scope allowing search engines to find them.
- Re-engageable
- Make re-engagement easy through features like push notifications.
- Installable
- Allow users to "keep" apps they find most useful on their home screen without the hassle of an app store.
- Linkable
- Easily share via URL and not require complex installation.
It's worth taking a moment to unpack the "app-like" part of that. Fundamentally, there are two parts to a PWA: service workers (which we'll come to in a minute), and application shell architecture. Google defines this as:
...the minimal HTML, CSS, and JavaScript powering a user interface. The application shell should:An application shell is the secret to reliably good performance. Think of your app's shell like the bundle of code you'd publish to an app store if you were building a native app. It's the load needed to get off the ground, but might not be the whole story. It keeps your UI local and pulls in content dynamically through an API.
- load fast
- be cached
- dynamically display content
– Instant Loading Web Apps with an Application Shell Architecture
This method of loading content allows for incredibly fast perceived speed. We are able to get something that looks like our site in front of a user almost instantly, just without any content. The page will then go and fetch the content and all's well. Obviously, if we actually did things this way in the real world, we'd run in to SEO issues pretty quickly, but we'll address that later too.
If then, at their core, a Progressive Web App is just a website served in a clever way with extra features for loading stuff, why would we want one?
The use case
Let me be clear before I get into this: for most people, a PWA is something you don't need. That's important enough that it bares repeating, so I'll repeat it:
You probably don't need a PWA.
The reason for this is that most websites don't need to be able to behave like an app. This isn't to say that there's no benefit to having the things that PWA functionality can bring, but for many sites, the benefits don't outweigh the time it takes to implement the functionality at the moment.
When should you look at a PWA then? Well, let's look at a checklist of things that may indicate that you do need one...
Signs a PWA may be appropriate
You have:
- Content that regularly updates, such as stock tickers, rapidly changing prices or inventory levels, or other real-time data
- A chat or comms platform, requiring real-time updates and push notifications for new items coming in
- An audience likely to pull data and then browse it offline, such as a news app or a blog publishing many articles a day
- A site with regularly updated content which users may check in to several times a day
- Users who are mostly using a supported browser
In short, you have something beyond a normal website, with interactive or time-sensitive components, or rapidly released or updated content. A good example is the Google Weather PWA:
If you're running a normal site, with a blog that maybe updates every day or two, or even less frequently, then whilst it might be nice to have a site that acts as a PWA, there's probably more useful things you can be doing with your time for your business.
How they work
So, you have something that would benefit from this sort of functionality, but need to know how these things work. Welcome to the wonder that is the service worker.
Service workers can be thought of as a proxy that sits between your website and the browser. It calls for intercept of things you ask the browser to do, and hijacking of the responses given back. That means we can do things like, for example, hold a copy of data requested, so when it's asked for again, we can serve it straight back (this is called caching). This means we can fetch data once, then replay it a thousand times without having to fetch it again. Think of it like a musician recording an album — it means they don't have to play a concert every time you want to listen to their music. Same thing, but with network data.
If you want a more thorough explanation of service workers, check out this moderately technical talk given by Jake Archibald from Google.
What service workers can do
Service workers fundamentally exist to deliver extra features, which have not been available to browsers until now. These includes things like:
- Push notifications, for telling a user that something has happened, such as receiving a new message, or that the page they're viewing has been updated
- Background sync, for updating data while a user isn't using the page/site
- Offline caching, to allow a for an experience where a user still may be able to access some functionality of a site while offline
- Handling geolocation or other device hardware-querying data (such as device gyrpscope data)
- Pre-fetching data a user will soon require, such as images further down a page
It's planned that in the future, they'll be able to do even more than they currently can. For now though, these are the sorts of features you'll be able to make use of. Obviously these mostly load data via AJAX, once the app is already loaded.
What are the SEO implications?
So you're sold on Progressive Web Apps. But if you create one, how will you make sure it ranks? As with any new front-end technology, there are always implications for your SEO visibility. But don't panic; the potential issues you'll encounter with a PWA have been solved before by SEOs who have worked on JavaScript-heavy websites. For a primer on that, take a look at this article on JS SEO.
There are a few issues you may encounter if you're going to have a site that makes use of application shell architecture. Firstly, it's pretty much required that you're going to be using some form of JS framework or view library, like Angular or React. If this is the case, you're going to want to take a look at some Angular.JS or React SEO advice. If you're using something else, the short version is you'll need to be pre-rendering pages on the server, then picking up with your application when it's loaded. This enables you to have all the good things these tools give you, whilst also serving something Google et al can understand. Despite their recent advice that they're getting good at rendering this sort of application, we still see plenty of examples in the wild of them flailing horribly when they crawl heavy JS stuff.
Assuming you're in the world of clever JS front-end technologies, to make sure you do things the PWA way, you'll also need to be delivering the CSS and JS required to make the page work along with the HTML. Not just including script
tags with the <code>src attribute, but the whole file, inline.
Obviously, this means you're going to increase the size of the page you're sending down the wire, but it has the upside of meaning that the page will load instantly. More than that, though, with all the JS (required for pick-up) and CSS (required to make sense of the design) delivered immediately, the browser will be able to render your content and deliver something that looks correct and works straightaway.
Again, as we're going to be using service workers to cache content once it's arrived, this shouldn't have too much of an impact. We can also cache all the CSS and JS external files required separately, and load them from the cache store rather than fetching them every time. This does make it very slightly more likely that the PWA will fail on the first time that a user tries to request your site, but you can still handle this case gracefully with an error message or default content, and re-try on the next page view.
There are other potential issues people can run in to, as well. The Washington Post, for example, built a PWA version of their site, but it only works on a mobile device. Obviously, that means the site can be crawled nicely by Google's mobile bots, but not the desktop ones. It's important to respect the P part of the acronym — the website should enable features that a user can make use of, but still work in a normal manner for those who are using browsers that don't support them. It's about enhancing functionality progressively, not demanding that people upgrade their browser.
The only slightly tricky thing with all of this is that it requires that, for best experience, you design your application for offline-first experiences. How that's done is referenced in Jake's talk above. The only issue with going down that route: you're only serving content once someone's arrived at your site and waited long enough to load everything. Obviously, in the case of Google, that's not going to work well. So here's what I'd suggest...
Rather than just sending your application shell, and then using AJAX to request content on load, and then picking up, use this workflow instead:
- User arrives at site
- Site sends back the application shell (the minimum HTML, JS, and CSS to make everything work immediately), along with...
- ...the content AJAX response, pre-loaded as state for the application
- The application loads that immediately, and then picks up the front end.
Adding in the data required means that, on load, we don't have to make an AJAX call to get the initial data required. Instead, we can bundle that in too, so we get something that can render content instantly as well.
As an example of this, let's think of a weather app. Now, the basic model would be that we send the user all the content to show a basic version of our app, but not the data to say what the weather is. In this modified version, we also send along what today's weather is, but for any subsequent data request, we then go to the server with an AJAX call.
This means we still deliver content that Google et al can index, without possible issues from our AJAX calls failing. From Google and the user's perspective, we're just delivering a very high-performance initial load, then registering service workers to give faster experiences for every subsequent page and possibly extra functionality. In the case of a weather app, that might mean pre-fetching tomorrow's weather each day at midnight, or notifying the user if it's going to rain, for example.
Going further
If you're interested in learning more about PWAs, I highly recommend reading this guide to PWAs by Addy Osmani (a Google Chrome engineer), and then putting together a very basic working example, like the train one Jake mentions in his YouTube talk referenced earlier. If you're interested in that, I recommend Jake's Udacity course on creating a PWA available here.
Thanks Pete for this article. The truth is that after reading me questions arise as to classmates. A PWA is equally functional qu8e a website? Does SEO works in the same way? Can you combine a strategy of PWA with a website or run risk of duplicate content?
From what I gathered at the MozCon 2016 speaker, Cindy Krum, PWA will use Google Firebase to help drive indexing of progressive web app content, including Deep Links, Dynamic Links, and Angular JS web apps. So its not really form of duplicate content, esp in regards to FireBase [ which is insanely powerful ] which is like its own index! I think her slide dec is up on www.moz.com/mozcon, hope this answer helps!
Firebase is more like Services as a Service (things your apps might use, available and hosted by someone else). So firebase enables you to create an app without having to worry about the middleware and back end. It's a cool thing, but it's far more than just something that you can use to create a PWA. It's something to power all the back end of an app.
The idea would be that if everything you had was on Firebase, you wouldn't have another version somewhere else - the Firebase back end would power your app everywhere. There's no duplication to have a duplicate content issue.
Hope that makes sense!
Thanks for that detail breakdown of Firebase. Sounds like a win/win for Google and Content Vendor!
Pete and Cah thank you very much for clarifying this question.
Answering the original question here - because the PWA is the website, there's no duplicate content issue. Think of it more like responsive web design taken a step further, with extra functionality enabled for mobile users vs desktop. It's about treating the web as a first class citizen on mobile, along with native apps. So in the same way as you get a different mobile design when you scale a site down, this would also allow for other things beyond just a tidy mobile design (like push notifications for an example).
Right on, I didn't find a single article that could compare to this one in terms of detailed explanation for progressive web apss.
I really appreciate the effort for making this post happen.
It can truly be said that PWC can become a truly different face of the web. The Washington POst and AliExpress are already on it - and I see more of them hopping on the train in the future!
Thanks for sharing your expertise with us, Pete!
Thanks for sharing Pete, great explanation! Given me a lot to think about.
Definitely interesting, and something that I may consider implementing in future should I work on a website that may benefit from it.
Do you have a list of real-life examples of sites that are considered PWA, so I can check them out and see whassup?
Sure. Best place to look would be https://pwa.rocks/ and https://github.com/hemanth/awesome-pwa
Thanks for this, it is what I was looking for as well. Maybe you could include more examples in the post itself.
Another good article Ria is https://developers.google.com/web/progressive-web-apps/ and https://www.udacity.com/course/intro-to-progressive-web-apps--ud811. There are really useful resources and keep an eye on google, i hear some rumors that they may release a new one by the end of the year
Interesting post
some questions arise me ... Is it possible that an PWA can be as functional as in its web version is where we find deficiencies? A SEO work would then be the same or different we would have to draw on its Web version?
There is only the web version of a PWA. The local version running on a mobile device is the website itself, just appearing like a native app because the URL bar is hidden. So there's just the website, and no true native app.
Hi Pete, I enjoyed reading your article there are really interesting having the way we do SEO is one of them.
However, I differ in a point that you mention push notifications and geolocation aren't feature related with service workers from my point of view are browser related and we integrate in order to build or PWA in fact you have API that you can use even in normal web example of that it's slack notifications or google maps.
A second point that I want to high you don't really need a JS framework to build your PWA (it's helps but it's not a requirement),
Another point that it's required for call an app as PWA it's the idea to optimize the data and architecture so potentially the size of your projectwill get reduce, initially you will have a extra files for additional features but over time your project should be smaller.
Additionally the approach of Washington post of mobile only I believe it doesn't fulfil the principles of PWA example the article wrote by Alex this week clarify those aspects.
An final consideration, I want to make it's the important in term of SEO will change slightly adding a new component where the user are going to use less google for susenquent visit because the app is already in your phone so it's not need to search for it. Therefore my advice when you see drop your statistics remember that your user is now close to a native app behaviour.
I hope these considerations helps to improve our vision in PWA and I look forward for more articles like this, thanks for taking the time to write it
Hey Pete,
Very informative article, thanks for sharing!
Note: You spelled Gandhi wrong.
A great insight about Progressive Web Apps. It is really interesting!! Keep sharing!!
very informative and useful article. It is very helpful for all SEO experts . I also gets more information from https://www.webdesignagency.ae/. Great post. thanks for sharing.
Really interesting insights Pete.
Looks like google is moving towards a faster user experience. Load speed as a ranking factor, Progressive Web Apps, AMP.
"Ghandi and Dumbledore"........Oh!
Great to say about PWA. I getting inspired from this post. Web App are really very helpful for us. Thanks for sharing with us.
Progressive WebApps- The App with more new features. Hope this App will appear with revolutionary thought...
First time I am hearing about progressive web apps, looking forward to using them.
Hi, great article!
I am new into this but I wonder do you think PWA has the potential to overtake normal native App development in future?
I ask because I am looking to startup a App which helps users with dyslexia. I have been scouring the web to understand more, and wonder is PWA could possibly be a better option for me then costly outsourced developments. Thanks! :D
Hey,
Great Article! Got some really good insights on why PWAs are used.
I have a query though. It was mentioned in the article that PWA sends push notification. Wouldn't that irritate a user who might not expect and want to receive these notifications? Also the user might discard these notifications. How would it work then?
The user would be presented with a dialogue asking if they want the notifications. If they want to revoke that permission, then they can.
Great article, very detailed. I've always been a huge fan of the web vs purely native. I think it makes much more sense in the long run. Two years ago, I dedicated a Medium piece to the topic (7 reasons why appstores are doomed: https://medium.com/@adsy_me/7-reasons-why-appstores-are-doomed-ce05dda53e7c#.xj48cimo6) It resonates even more today. The web app (to create micro websites) https://adsy.me which I launched almost 2 years ago still works seamlessly across all major browsers, both on desktop & mobile, without any update since last year. That's the beauty of web technologies, when properly crafted ;-) Long live the WWW!
RIP - app store. Thanks for the extra article link Frederick!
Nice explanation. I thing in web, PWA is a new concept. I am looking forward to it.
Thanks for sharing
PWA sound a new concept in web & I am looking future in it and I believe it will take place against Apps.
PWAs, without MOZCON I dont think the headline would of drawn me in! I was always like, why do I have to code again. With new coding framework, now there's truely a mobile way to reach users! Thanks for this!!
Very cool!
Excellente analyse ! Merci pour votre partage d'expérience ;-)
thanks for sharing this article with us and I became clearer what PWA, and the utility that can give you
Interesting! But, with the increasing popularity of apps, one must give a deep thought before going for a PWA.
Hi Pete,
Thank for the great detail and getting the word out.
One thing that I think could be misconstrued is the notion that a PWA == a mobile micro app.
E.g. You probably don't need a PWA. and the weather example.
Some of the early samples were in that vein but this isn't what PWA is all about. We want the web to come up to speed on mobile and beyond.
Alex Russell recently brought this up in "What, exactly, is a Progressive Web App?"
Flipkart also just talked about how they brought their mobile PWA and brought it to desktop. It's a great read and you can see how this is very much about making a great performing website.
Cheers,
Dion
Looks like "Ghandi" is misspelled.