aboutsummaryrefslogtreecommitdiffhomepage
path: root/ui/static/js/sw.js
blob: 8e32fcbb417db2468088d48dd0be8764c2f15869 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;
                    });
                });
            })
        );
    }
});