first install or re-isntall addEventListener('install', function(event) { ... } // when the page connects to a SW addEventListener( 'activate', function(event) { ... } // when the browser makes a request (js/css/img/video) addEventListener( 'fetch', function(event) { ... }
• Use bundle splitting • Deferred fetching with lazy loading • Prefetching • Take advantage of cache and web storage • Pretty much every other thing to make your web app fast and deliver better user experience
bandwidth or RTT is slower than a typical 3G connection || (navigator.connection.effectiveType.match( /2g/ ) ) // we have less than ~1GB of RAM || (navigator.deviceMemory < 1 ) ) {
bandwidth or RTT is slower than a typical 3G connection || (navigator.connection.effectiveType.match( /2g/ ) ) // we have less than ~1GB of RAM || (navigator.deviceMemory < 1 ) ) {
bandwidth or RTT is slower than a typical 3G connection || (navigator.connection.effectiveType.match( /2g/ ) ) // we have less than ~1GB of RAM || (navigator.deviceMemory < 1 ) // we are on meh cellular || (this.cell === true && this.rtt >= 100) ) {