Don't save badges

This commit is contained in:
Brandon Rozek 2024-10-19 21:52:15 -04:00
parent be3e20feb6
commit 55a8368001
No known key found for this signature in database
GPG key ID: 26E457DA82C9F480

View file

@ -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;
});
})
);