miniflux/ui/static/js/sw.js

15 lines
521 B
JavaScript
Raw Normal View History

2018-07-16 06:51:09 +02:00
self.addEventListener("fetch", (event) => {
if (event.request.url.includes("/feed/icon/")) {
event.respondWith(
caches.open("feed_icons").then((cache) => {
return cache.match(event.request).then((response) => {
return response || fetch(event.request).then((response) => {
cache.put(event.request, response.clone());
return response;
});
});
})
);
}
});