-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1fec2c
commit f8d84c4
Showing
2 changed files
with
57 additions
and
1 deletion.
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
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,32 @@ | ||
importScripts('https://cdn.jsdelivr.net/npm/[email protected]/workbox/workbox-sw.js') | ||
|
||
// -------------------------------------------------- | ||
// Configure | ||
// -------------------------------------------------- | ||
|
||
// Set workbox config | ||
workbox.setConfig({ | ||
"debug": false | ||
}) | ||
|
||
// Start controlling any existing clients as soon as it activates | ||
workbox.core.clientsClaim() | ||
|
||
// Skip over the SW waiting lifecycle stage | ||
workbox.core.skipWaiting() | ||
|
||
workbox.precaching.cleanupOutdatedCaches() | ||
|
||
// -------------------------------------------------- | ||
// Precaches | ||
// -------------------------------------------------- | ||
|
||
// Precache assets | ||
|
||
// -------------------------------------------------- | ||
// Runtime Caching | ||
// -------------------------------------------------- | ||
|
||
// Register route handlers for runtimeCaching | ||
workbox.routing.registerRoute(new RegExp('/fileadmin/.*'), new workbox.strategies.NetworkFirst ({"cacheName":"assets-cache","maxAgeSeconds":86400}), 'GET') | ||
workbox.routing.registerRoute(new RegExp('/'), new workbox.strategies.NetworkFirst ({}), 'GET') |