Service workers and SEO: What developers should know
What are service workers, why would you implement them and what's the potential impact on your site's rankings? Find out.
Native app UX
Static vs. dynamic
Although you can already write a basic website on your desktop to open in a browser and you might even transfer files to a phone, the result has always been very static.
For example, with your basic site open in a browser, you can write a notification. But if you don’t have the website open in a browser, it won’t work. To have a remote website trigger a notification when your local website is not running in a browser, you need a service worker. Service workers let you do that, which is very powerful.
Think of the service worker as the magic that lets the SEO-savvy developer create a website with features that communicate to users who “install” an app. Users can install as much as a PWA (Progressive Web App), or, at minimum, some representation of the website onto their computers, tablets, and phones. Communication capabilities are then augmented with features like push notifications and dynamic content on the device.
Before you ask your developers to implement something like this, make sure that whatever you want to build, you are building for the right reasons. The decision tree begins with: What website are you considering adding service worker capabilities to, and why? Will just a simple notification service suffice or should you really build a whole downloadable web app? What devices are you targeting and what UX do you expect? Do you want to retrieve time-sensitive information such as sports scores or stock prices?
Personally, I have someone in mind when I consider the audience that would benefit from a PWA. She often hikes to heights where there is no cell service and she wants an app which works offline. As explained above, she wouldn’t need service workers for a basic website. For that, I could write files and transfer them to her device. But that wouldn’t allow for any updates or more dynamic features. Service workers have been designed explicitly to enable the creation of a PWA that would work both online and off. I don’t have to transfer updates to her files by hand to update the site on her device? Brilliant.
With a PWA, I can store app “shell” files (think of them as layout files) on the device, and a global cache object lets me load local content or retrieve the latest dynamic content, depending on the circumstances. I can write logic using the service workers API to load the app in the fastest possible manner whether online or off. That totally rivals what most native apps do, and I don’t have to submit it to be approved for a store’s walled garden. I can use my own pay mechanism, too.
How do service workers affect SEO? In a small, indirect way they do, but you’re not going to be able to write some service worker hack to raise all your rankings.
Security awareness by browser makers restricts the API to employing only the vital methods required to implement the desired feature capability, including TLS (SSL or what you might know as HTTPS) to operate. There’s not much to know about here when it comes to general SEO, but SEO developers and technical SEO practitioners may derive some benefits.
What you may be able to take advantage of is that Google is crawling to index websites and can thereby recognize when a website has a PWA offering. Perhaps they’ll put an icon for direct install in their SERPs. It probably won’t be anytime soon, because of major trust issues, but it’s possible they might otherwise indicate that a website has a PWA offering in their SERPs. But remember, you must still do SEO for the source website so that your PWA is discoverable in the first place.
Close to the edge
“Edge SEO” — defined by Dan Taylor, who coined the term, as “using edge computing technologies to create new SEO implementation, testing, and research processes” — is an exciting possibility on the horizon for Technical SEO practitioners, but replacing content in order to manipulate rankings can be perilous. According to Taylor, “With service workers, you’re modifying the DOM response. Google renders the changes within the HTML it sees.”
Therefore it is important to proceed cautiously and retain control. Edge SEO is an incredibly powerful approach when you can’t implement Technical SEO that should otherwise be repaired at the core.