mirror of https://github.com/nealey/vail.git
Maybe fix some service worker tomfoolery
This commit is contained in:
parent
fbc489dfdc
commit
c64708fa05
|
@ -16,8 +16,12 @@ function install(event) {
|
|||
|
||||
self.addEventListener("fetch", e => cacheFetch(e))
|
||||
function cacheFetch(event) {
|
||||
let fetchInit = {}
|
||||
if (event.request.match(/(css|js|html)$/)) {
|
||||
fetchInit.cache = "no-cache"
|
||||
}
|
||||
event.respondWith(
|
||||
fetch(event.request)
|
||||
fetch(event.request, fetchInit)
|
||||
.catch(() => {
|
||||
return caches.match(event.request)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue