mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2024-11-22 00:06:30 -05:00
Don't save badges
This commit is contained in:
parent
be3e20feb6
commit
55a8368001
1 changed files with 52 additions and 51 deletions
|
@ -70,12 +70,14 @@ self.addEventListener('fetch', function (event) {
|
|||
fetch(request).then(function (response) {
|
||||
// If successful, create a copy of the response
|
||||
// and save it to the cache
|
||||
// Note: Ignore badges
|
||||
if (request.url.includes("/badges")) {
|
||||
let cacheCopy = response.clone();
|
||||
event.waitUntil(caches.open(version + cacheName).then(function (cache) {
|
||||
return cache.put(request, cacheCopy);
|
||||
}));
|
||||
}
|
||||
return response;
|
||||
|
||||
}).catch(function (error) {
|
||||
// Otherwise, check the cache.
|
||||
return caches.match(request).then(function (response) {
|
||||
|
@ -84,7 +86,6 @@ self.addEventListener('fetch', function (event) {
|
|||
return response || caches.match(offlinePage);
|
||||
}
|
||||
return response;
|
||||
|
||||
});
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue