Skip to content

Commit

Permalink
Update Service Worker files
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexJSully committed May 3, 2024
1 parent 8f41f3d commit e819175
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/serviceWorker/sw.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/serviceWorker/sw.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/serviceWorker/workbox-717fa00d.js

This file was deleted.

2 changes: 2 additions & 0 deletions src/serviceWorker/workbox-db952f2a.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

53 changes: 27 additions & 26 deletions workbox-config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
module.exports = {
"globDirectory": "./src/",
"globPatterns": [
"**/*.{html,json,jpg,png,mp4,gif,xml,ico,svg,webmanifest,js,css,webp}"
],
"swDest": "./src/serviceWorker/sw.js",
"globIgnores": [
'index.html',
'workbox-config.js',
'package.json',
'package-lock.json'
],
"globDirectory": "./src/",
"globPatterns": [
"**/*.{html,json,jpg,png,mp4,gif,xml,ico,svg,webmanifest,js,css,webp}"
],
"swDest": "./src/serviceWorker/sw.js",
"globIgnores": [
'index.html',
'workbox-config.js',
'package.json',
'package-lock.json',
'node_modules/**/*',
],

// Define runtime caching rules.
"runtimeCaching": [{
// Match any request that ends with .png, .jpg, .jpeg, .webp, .ico or .svg
"urlPattern": /\.(?:png|jpg|jpeg|webp|ico|svg)$/,
// Define runtime caching rules.
"runtimeCaching": [{
// Match any request that ends with .png, .jpg, .jpeg, .webp, .ico or .svg
"urlPattern": /\.(?:png|jpg|jpeg|webp|ico|svg)$/,

// Apply a cache-first strategy.
"handler": 'CacheFirst',
// Apply a cache-first strategy.
"handler": 'CacheFirst',

"options": {
// Use a custom cache name.
"cacheName": 'images',
"options": {
// Use a custom cache name.
"cacheName": 'images',

// Only cache 10 images.
"expiration": {
"maxEntries": 10,
},
},
}],
// Only cache 10 images.
"expiration": {
"maxEntries": 10,
},
},
}],
};

0 comments on commit e819175

Please sign in to comment.