This file contains 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 characters
// Runs whenever there is a fetch request | |
self.addEventListener("fetch", (event) => { | |
// Checks the cache to find matching request. | |
// If there is a cached version of the request, it returns the cached version, otherwise it makes a new request. | |
event.respondWith( | |
caches.match(event.request).then((res) => { | |
return res || fetch(event.request); | |
}) | |
); | |
}); |
This file contains 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 characters
{ | |
"name": "Studylove PWA", | |
"short_name": "Studylove", | |
"description": "This is a PWA tutorial created by Steph Crown", | |
"start_url": ".", | |
"background_color": "#B3D1FF", | |
"theme_color": "#0A0F75", | |
"display": "standalone", | |
"icons": [ | |
{ |
OlderNewer