self.addEventListener('install', (e) => {
  e.waitUntil(
    caches.open('matzeflix-v1').then((cache) => cache.addAll([
      '/',
      '/settings/',
    ])),
  );
});

self.addEventListener('fetch', (e) => {
  e.respondWith(
    caches.match(e.request).then((response) => response || fetch(e.request)),
  );
});
