forked from gdgbari/2023-web-devfest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: sw replacement + bigger img on mobile
- Loading branch information
Showing
6 changed files
with
29 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# Cache fix: | ||
/* | ||
Cache-Control: public, max-age=300, s-maxage=600 | ||
Clear-Site-Data: "storage" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// sw.js from https://developer.chrome.com/docs/workbox/remove-buggy-service-workers?hl=it | ||
|
||
self.addEventListener('install', () => { | ||
// Skip over the "waiting" lifecycle state, to ensure that our | ||
// new service worker is activated immediately, even if there's | ||
// another tab open controlled by our older service worker code. | ||
self.skipWaiting(); | ||
}); | ||
|
||
self.addEventListener('activate', () => { | ||
// Optional: Get a list of all the current open windows/tabs under | ||
// our service worker's control, and force them to reload. | ||
// This can "unbreak" any open windows/tabs as soon as the new | ||
// service worker activates, rather than users having to manually reload. | ||
self.clients.matchAll({ | ||
type: 'window' | ||
}).then(windowClients => { | ||
windowClients.forEach((windowClient) => { | ||
windowClient.navigate(windowClient.url); | ||
}); | ||
}); | ||
}); |
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
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
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
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