blob: fc0a4c86c279215b60593ca399d4a6d0aae89a03 [file] [log] [blame]
self.addEventListener('install', (event) => {
event.waitUntil(caches.open("cache_name").then((cache) => {
return cache.addAll(['/WebKit/service-workers/resources/navigation-timing-part-2.html']);
}));
});
self.addEventListener('fetch', (event) => {
setTimeout(()=>{
event.respondWith(caches.open("cache_name").then((cache) => {
return cache.match(event.request).then((response) => {
if (!response)
return fetch(event.request);
return response;
});
}));
}, 500);
});