mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 13:48:40 +00:00
add freesound + shabda to offline cache rule
This commit is contained in:
parent
6a5d849b3c
commit
3671344867
@ -37,12 +37,18 @@ export default defineConfig({
|
|||||||
globPatterns: ['**/*.{js,css,html,ico,png,svg,json,wav,mp3,ogg}'],
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,json,wav,mp3,ogg}'],
|
||||||
runtimeCaching: [
|
runtimeCaching: [
|
||||||
{
|
{
|
||||||
urlPattern: /^https:\/\/raw\.githubusercontent\.com\/.*/i,
|
urlPattern: ({ url }) => {
|
||||||
|
[
|
||||||
|
/^https:\/\/raw\.githubusercontent\.com\/.*/i,
|
||||||
|
/^https:\/\/freesound\.org\/.*/i,
|
||||||
|
/^https:\/\/shabda\.ndre\.gr\/.*/i,
|
||||||
|
].some((regex) => regex.test(url));
|
||||||
|
},
|
||||||
handler: 'CacheFirst',
|
handler: 'CacheFirst',
|
||||||
options: {
|
options: {
|
||||||
cacheName: 'github-files',
|
cacheName: 'github-files',
|
||||||
expiration: {
|
expiration: {
|
||||||
maxEntries: 200,
|
maxEntries: 5000,
|
||||||
maxAgeSeconds: 60 * 60 * 24 * 30, // <== 14 days
|
maxAgeSeconds: 60 * 60 * 24 * 30, // <== 14 days
|
||||||
},
|
},
|
||||||
cacheableResponse: {
|
cacheableResponse: {
|
||||||
@ -53,7 +59,7 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
devOptions: {
|
devOptions: {
|
||||||
enabled: true,
|
enabled: false,
|
||||||
},
|
},
|
||||||
manifest: {
|
manifest: {
|
||||||
includeAssets: ['favicon.ico', 'icons/apple-icon-180.png', 'favicon.svg'],
|
includeAssets: ['favicon.ico', 'icons/apple-icon-180.png', 'favicon.svg'],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user