pwa-connection-type
pwa-connection-type copied to clipboard
A tiny service worker script to change image quality dependant on connection type (2G, 3G, etc)
The Network Information API allows developers to determine the connection types and the underlying connection technology that the user agent is using. In terms of web performance, this brings a whole new level to the way that we build web pages. Being able to reliably determine whether or not a user has a slow 2G connection or a speedy Wifi connection allows developers to serve content accordingly.
If you'd like to learn more about using the Network Information API together with service workers, I have written an article on my blog at deanhume.com