<commit_before>self.addEventListener('install', (event) => {
  event.waitUntil(preLoad());
});

const preLoad = () => {
  return caches.open('dnevnik-sw').then((cache) => {
  return cache.addAll([
              '/',
              '/main',
              '/css/material.deep_orange-blue.min.css.br',
              '/css/styles-deep_orange.css.br',
              '/css/material.deep_purple-blue.min.css.br',
              '/css/styles-deep_purple.css.br',
              '/css/material.teal-blue.min.css.br',
              '/css/styles-teal.css.br',
              '/css/material.pink-blue.min.css.br',
              '/css/styles-pink.css.br',
              '/css/md_icons.css.br',
              '/css/Roboto.css.br',
              '/js/compressed.js.br',
              '/js/material.min.js.br',
              '/config/browserconfig.xml',
              '/config/manifest.json',
              '/fonts/md_icons.woff2',
              '/fonts/Medium/Roboto-Medium.woff2',
              '/fonts/Regular/Roboto-Regular.woff2'
    ]);
  });
};

self.addEventListener('fetch', (event) => {
  if (event.request.method == 'POST') {
    event.respondWith(checkResponse(event.request).catch(() => {
      return returnFromCache(event.request);
    }));
  } else {
    event.respondWith(returnFromCache(event.request).catch(() => {
      return checkResponse(event.request);
    }));
  }

  event.waitUntil(addToCache(event.request));
});
<commit_msg>SW fix<commit_after>self.addEventListener('install', (event) => {
  event.waitUntil(preLoad());
});

const preLoad = () => {
  return caches.open('dnevnik-sw').then((cache) => {
  return cache.addAll([
              '/',
              '/main',
              '/css/material.deep_orange-blue.min.css.br',
              '/css/styles-deep_orange.css.br',
              '/css/material.deep_purple-blue.min.css.br',
              '/css/styles-deep_purple.css.br',
              '/css/material.teal-blue.min.css.br',
              '/css/styles-teal.css.br',
              '/css/material.pink-blue.min.css.br',
              '/css/styles-pink.css.br',
              '/css/md_icons.css.br',
              '/css/Roboto.css.br',
              '/js/compressed.js.br',
              '/js/material.min.js.br',
              '/config/browserconfig.xml',
              '/config/manifest.json',
              '/fonts/md_icons.woff2',
              '/fonts/Medium/Roboto-Medium.woff2',
              '/fonts/Regular/Roboto-Regular.woff2'
    ]);
  });
};

self.addEventListener('fetch', (event) => {
  if (event.request.url === self.location.origin + "/up" || event.request.url === self.location.origin + "/login" || event.request.method == 'POST') {
    event.respondWith(checkResponse(event.request).catch(() => {
      return returnFromCache(event.request);
    }));
  } else {
    event.respondWith(returnFromCache(event.request).catch(() => {
      return checkResponse(event.request);
    }));
  }

  event.waitUntil(addToCache(event.request));
});

{'fraction_non_alphanumeric': 0.18787878787878787, 'fraction_numerical': 0.00202020202020202, 'mean_word_length': 1.9650698602794412, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2414649', 'n_tokens_mistral': 958, 'n_tokens_neox': 935, 'n_words': 87}