Last active
July 21, 2020 14:38
-
-
Save gokulkrishh/1b47bad975eed2f50f66 to your computer and use it in GitHub Desktop.
Revisions
-
gokulkrishh revised this gist
Feb 11, 2016 . No changes.There are no files selected for viewing
-
gokulkrishh revised this gist
Feb 11, 2016 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ //After install, fetch event is triggered for every page request self.addEventListener("fetch", function (event) { console.log("Request -->", event.request.url); -
gokulkrishh revised this gist
Feb 11, 2016 . No changes.There are no files selected for viewing
-
gokulkrishh revised this gist
Feb 11, 2016 . No changes.There are no files selected for viewing
-
gokulkrishh revised this gist
Feb 11, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ self.addEventListener("fetch", function (event) { event.respondWith( caches.match(event.request) //To match current request with cached request it .then(function(response) { //If response found return it, else fetch again. return response || fetch(event.request); }) .catch(function(error) { -
gokulkrishh revised this gist
Feb 11, 2016 . No changes.There are no files selected for viewing
-
gokulkrishh created this gist
Feb 11, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ //After install, fetch event is triggered for every page request self.addEventListener("fetch", function (event) { console.log("Request -->", event.request.url); //To tell browser to evaluate the result of event event.respondWith( caches.match(event.request) //To match current request with cached request it .then(function(response) { //If response found return it else fetch again. return response || fetch(event.request); }) .catch(function(error) { console.error("Error: ", error); }) ); });