PageSourceSearch

https://gdtv24.com/service-worker.js?v=$%7BDate.now()%7D

js gdtv24.com collected 2026-10-09 17:37:19 UTC 1,345 bytes, 52 lines download raw bytes

1const CACHE_NAME = 'gundam-cache-v1';
2const urlsToCache = [
3  '/',
4  '/styles/main-2.0.6.css',
5  '/scripts/common-1.0.7.js',
6  '/images/logo/favicon.png'
7];
8
9// 설치 단계: 캐시에 파일 저장
10self.addEventListener('install', (event) => {
11  console.log('[SW] Service Worker installing...');
12  event.waitUntil(
13    caches.open(CACHE_NAME)
14      .then((cache) => {
15        console.log('[SW] Caching app shell...');
16        return cache.addAll(urlsToCache);
17      })
18  );
19});
20
21// 활성화 단계: 이전 캐시 정리
22self.addEventListener('activate', (event) => {
23  console.log('[SW] Service Worker activating...');
24  event.waitUntil(
25    caches.keys().then((cacheNames) => {
26      return Promise.all(
27        cacheNames.filter((key) => key !== CACHE_NAME)
28          .map((key) => caches.delete(key))
29      );
30    })
31  );
32});
33
34// fetch 요청 가로채기
35self.addEventListener('fetch', (event) => {
36  const req = event.request;
37
38  // HTML 문서 요청은 네트워크 우선 처리
39  if (req.mode === 'navigate') {
40    event.respondWith(
41      fetch(req).catch(() => caches.match('/offline.html'))
42    );
43    return;
44  }
45
46  // 그 외 자원은 캐시 우선 처리
47  event.respondWith(
48    caches.match(req).then((cachedRes) => {
49      return cachedRes || fetch(req);
50    })
51  );
52});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.