55// Incrementing CACHE_VERSION will kick off the install event and force previously cached
66// resources to be cached again.
77const CACHE_VERSION = 1
8- let CURRENT_CACHES = {
8+ const CURRENT_CACHES = {
99 offline : 'offline-v' + CACHE_VERSION
1010}
1111const OFFLINE_URL = 'offline.html'
1212
1313function createCacheBustedRequest ( url ) {
14- let request = new Request ( url , { cache : 'reload' } )
14+ const request = new Request ( url , { cache : 'reload' } )
1515 // See https://fetch.spec.whatwg.org/#concept-request-mode
1616 // This is not yet supported in Chrome as of M48, so we need to explicitly check to see
1717 // if the cache: 'reload' option had any effect.
@@ -20,7 +20,7 @@ function createCacheBustedRequest (url) {
2020 }
2121
2222 // If {cache: 'reload'} didn't have any effect, append a cache-busting URL parameter instead.
23- let bustedUrl = new URL ( url , self . location . href )
23+ const bustedUrl = new URL ( url , self . location . href )
2424 bustedUrl . search += ( bustedUrl . search ? '&' : '' ) + 'cachebust=' + Date . now ( )
2525 return new Request ( bustedUrl )
2626}
@@ -41,7 +41,7 @@ self.addEventListener('activate', event => {
4141 // Delete all caches that aren't named in CURRENT_CACHES.
4242 // While there is only one cache in this example, the same logic will handle the case where
4343 // there are multiple versioned caches.
44- let expectedCacheNames = Object . keys ( CURRENT_CACHES ) . map ( function ( key ) {
44+ const expectedCacheNames = Object . keys ( CURRENT_CACHES ) . map ( function ( key ) {
4545 return CURRENT_CACHES [ key ]
4646 } )
4747
0 commit comments