<commit_before>self.addEventListener('install', event => {
  console.log('V1 installing…');

  // cache a cat jpg
  event.waitUntil(
    caches.open('static-v1').then(cache => cache.add('./images/cat.jpg'))
  );
});

self.addEventListener('activate', event => {
  console.log('V1 now ready to handle fetches!');
});


self.addEventListener('installed', () => {
  console.log("v1 installed")
})

self.addEventListener('activated', event => {
  console.log("v1 activated")
  event.waitUntil(
    caches.keys().then(function(cacheNames) {
      return Promise.all(
        cacheNames.filter(function(cacheName) {
          // Return true if you want to remove this cache,
          // but remember that caches are shared across
          // the whole origin
        }).map(function(cacheName) {
          console.log("deleting cache");
          return caches.delete(cacheName);
        })
      );
    })
  );
})

self.addEventListener('fetch', event => {
  const url = new URL(event.request.url);

  // serve the cat jpg from the cache if the request is
  // same-origin and the path is '/images/dog.jpg'
  if (url.origin == location.origin && url.pathname.endsWith("images/dog.jpg")) {
    event.respondWith(caches.match('./images/cat.jpg'));
  }
});
<commit_msg>what is in cache keys<commit_after>self.addEventListener('install', event => {
  console.log('V1 installing…');

  // cache a cat jpg
  event.waitUntil(
    caches.open('static-v1').then(cache => cache.add('./images/cat.jpg'))
  );
});

self.addEventListener('activate', event => {
  console.log('V1 now ready to handle fetches!');
});


self.addEventListener('installed', () => {
  console.log("v1 installed")
})

self.addEventListener('activated', event => {
  console.log("v1 activated")
  event.waitUntil(
    console.log("caches keys", caches.keys());
    caches.keys().then(function(cacheNames) {
      return Promise.all(
        cacheNames.filter(function(cacheName) {
          // Return true if you want to remove this cache,
          // but remember that caches are shared across
          // the whole origin
        }).map(function(cacheName) {
          console.log("deleting cache");
          return caches.delete(cacheName);
        })
      );
    })
  );
})

self.addEventListener('fetch', event => {
  const url = new URL(event.request.url);

  // serve the cat jpg from the cache if the request is
  // same-origin and the path is '/images/dog.jpg'
  if (url.origin == location.origin && url.pathname.endsWith("images/dog.jpg")) {
    event.respondWith(caches.match('./images/cat.jpg'));
  }
});

{'fraction_non_alphanumeric': 0.16195273149941883, 'fraction_numerical': 0.0038744672607516468, 'mean_word_length': 3.0470219435736676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3287250', 'n_tokens_mistral': 780, 'n_tokens_neox': 767, 'n_words': 173}