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) { ... }