<commit_before>(self => {
	'use strict'

	const host = self.location.host,
				pathname = self.location.pathname.split('/').slice(0, -1).join('/')

	// Set a name for the current cache
	const cacheName = 'v1'

	// Default files to always cache
	const filesToCache = [
	]

	// Dont cache these files
	const cacheExemptFiles = [
	]

	self.addEventListener('install', e => {
		e.waitUntil(
			self.skipWaiting().then(() => {
				caches.open(cacheName).then(cache => {
					return cache.addAll(filesToCache)
				})
			})
		)
	})

	self.addEventListener('activate', e => {
		e.waitUntil(
			self.clients.claim().then(() => {
				caches.keys().then(cacheNames => {
					return Promise.all(cacheNames.map(thisCacheName => {
						if (thisCacheName !== cacheName) {
							return caches.delete(thisCacheName)
						}
					}))
				})
			})
		)
	})

	self.addEventListener('fetch', e => {
		let url = new URL(e.request.url)

		if ((url.protocol !== 'http:' && url.protocol !== 'https:') ||
			(url.host === host && url.pathname.startsWith('/api/'))) {
			return fetch(e.request)
		}

		e.respondWith(
			caches.match(e.request).then(cachedResponse => {
				if (cachedResponse) {
					const cachedResponseClone = cachedResponse.clone()
					if (
						(cachedResponseClone.headers.get('etag') && cachedResponseClone.headers.get('etag').length) ||
						(cachedResponseClone.headers.get('last-modified') && cachedResponseClone.headers.get('last-modified').length)
					) {
						fetch(e.request.clone()).then(fetchResponse => {
							if (
								cachedResponseClone.headers.get('etag') !== fetchResponse.headers.get('etag') &&
								cachedResponseClone.headers.get('last-modified') !== fetchResponse.headers.get('last-modified')
							) {
								caches.open(cacheName).then(cache => {
									cache.put(e.request, fetchResponse)
								})
							}<commit_msg>:bug: Fix a bug where a fetch will not be responded with e.repondWith<commit_after>(self => {
	'use strict'

	const host = self.location.host,
				pathname = self.location.pathname.split('/').slice(0, -1).join('/')

	// Set a name for the current cache
	const cacheName = 'v1'

	// Default files to always cache
	const filesToCache = [
	]

	// Dont cache these files
	const cacheExemptFiles = [
	]

	self.addEventListener('install', e => {
		e.waitUntil(
			self.skipWaiting().then(() => {
				caches.open(cacheName).then(cache => {
					return cache.addAll(filesToCache)
				})
			})
		)
	})

	self.addEventListener('activate', e => {
		e.waitUntil(
			self.clients.claim().then(() => {
				caches.keys().then(cacheNames => {
					return Promise.all(cacheNames.map(thisCacheName => {
						if (thisCacheName !== cacheName) {
							return caches.delete(thisCacheName)
						}
					}))
				})
			})
		)
	})

	self.addEventListener('fetch', e => {
		let url = new URL(e.request.url)

		if ((url.protocol !== 'http:' && url.protocol !== 'https:') ||
			(url.host === host && url.pathname.startsWith('/api/'))) {
			return e.respondWith(fetch(e.request))
		}

		e.respondWith(
			caches.match(e.request).then(cachedResponse => {
				if (cachedResponse) {
					const cachedResponseClone = cachedResponse.clone()
					if (
						(cachedResponseClone.headers.get('etag') && cachedResponseClone.headers.get('etag').length) ||
						(cachedResponseClone.headers.get('last-modified') && cachedResponseClone.headers.get('last-modified').length)
					) {
						fetch(e.request.clone()).then(fetchResponse => {
							if (
								cachedResponseClone.headers.get('etag') !== fetchResponse.headers.get('etag') &&
								cachedResponseClone.headers.get('last-modified') !== fetchResponse.headers.get('last-modified')
							) {
								caches.open(cacheName).then(cache => {
									cache.put(e.request, fetchResponse)
								})
							}
{'fraction_non_alphanumeric': 0.17138323194921978, 'fraction_numerical': 0.0015868817773075905, 'mean_word_length': 3.115342763873776, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '7256415', 'n_tokens_mistral': 1505, 'n_tokens_neox': 1203, 'n_words': 188}