pwa-builder / PWABuilder

The simplest way to create progressive web apps across platforms and devices. Start here. This repo is home to several projects in the PWABuilder family of tools.
https://docs.pwabuilder.com
Other
2.75k stars 284 forks source link

[SITE] If we find SW in initial fast API call but timeout on second, rely on the first result #4553

Open Jaylyn-Barbee opened 11 months ago

Jaylyn-Barbee commented 11 months ago

The problem: The fast API call scrapes HTML to look for a SW. Sometimes this will return true for has_service_worker but the second API waits for the page to load and for large sites, this can cause the SW api to timeout.

Right now, the second call of "no service worker" is overriding the first API response.

The solution: If the fast test returns true but the second test times out, we should reuse the HTTPS yellow warning banner to communicate the following general message: "We detected a link to your service worker however, our tests timed out waiting for it to be registered. This can happen for a number of reasons and may even be intentional. To learn more about site load times and when you should be registering your service worker, follow the link below."

That copy isn't final but that's the general idea. The "learn more" link would either to internal documentation or an appropriate external resource.

beth-panx commented 10 months ago

related #4552