bug1151916_worker.js (391B)
1 onactivate = function (e) { 2 e.waitUntil( 3 self.caches.open("default-cache").then(function (cache) { 4 var response = new Response("Hi there"); 5 return cache.put("madeup.txt", response); 6 }) 7 ); 8 }; 9 10 onfetch = function (e) { 11 if (e.request.url.match(/madeup.txt$/)) { 12 var p = self.caches.match("madeup.txt", { cacheName: "default-cache" }); 13 e.respondWith(p); 14 } 15 };