sw.js 521 B

1234567891011121314
  1. self.addEventListener("fetch", (event) => {
  2. if (event.request.url.includes("/feed/icon/")) {
  3. event.respondWith(
  4. caches.open("feed_icons").then((cache) => {
  5. return cache.match(event.request).then((response) => {
  6. return response || fetch(event.request).then((response) => {
  7. cache.put(event.request, response.clone());
  8. return response;
  9. });
  10. });
  11. })
  12. );
  13. }
  14. });