remove console.logs
This commit is contained in:
parent
b8d7ae3d8b
commit
a0d7e2c780
|
@ -73,14 +73,14 @@ self.addEventListener('fetch', event => {
|
||||||
// Non-GET and for certain endpoints (e.g. OAuth), go network-only
|
// Non-GET and for certain endpoints (e.g. OAuth), go network-only
|
||||||
if (req.method !== 'GET' ||
|
if (req.method !== 'GET' ||
|
||||||
NETWORK_ONLY.some(pattern => url.pathname.startsWith(pattern))) {
|
NETWORK_ONLY.some(pattern => url.pathname.startsWith(pattern))) {
|
||||||
console.log('Using network-only for', url.href)
|
//console.log('Using network-only for', url.href)
|
||||||
event.respondWith(fetch(req))
|
event.respondWith(fetch(req))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// For these, go cache-first.
|
// For these, go cache-first.
|
||||||
if (CACHE_FIRST.some(pattern => url.pathname.startsWith(pattern))) {
|
if (CACHE_FIRST.some(pattern => url.pathname.startsWith(pattern))) {
|
||||||
console.log('Using cache-first for', url.href)
|
//console.log('Using cache-first for', url.href)
|
||||||
event.respondWith(caches
|
event.respondWith(caches
|
||||||
.open(`offline${timestamp}`)
|
.open(`offline${timestamp}`)
|
||||||
.then(async cache => {
|
.then(async cache => {
|
||||||
|
@ -107,7 +107,7 @@ self.addEventListener('fetch', event => {
|
||||||
.open(`offline${timestamp}`)
|
.open(`offline${timestamp}`)
|
||||||
.then(async cache => {
|
.then(async cache => {
|
||||||
try {
|
try {
|
||||||
console.log('Using network-first for', url.href)
|
//console.log('Using network-first for', url.href)
|
||||||
const response = await fetch(req)
|
const response = await fetch(req)
|
||||||
cache.put(req, response.clone())
|
cache.put(req, response.clone())
|
||||||
return response
|
return response
|
||||||
|
|
Loading…
Reference in a new issue