fix cache rule + disable service worker in dev
This commit is contained in:
parent
3671344867
commit
b6e42876ad
1 changed files with 3 additions and 4 deletions
|
|
@ -37,16 +37,15 @@ 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: ({ url }) => {
|
urlPattern: ({ url }) =>
|
||||||
[
|
[
|
||||||
/^https:\/\/raw\.githubusercontent\.com\/.*/i,
|
/^https:\/\/raw\.githubusercontent\.com\/.*/i,
|
||||||
/^https:\/\/freesound\.org\/.*/i,
|
/^https:\/\/freesound\.org\/.*/i,
|
||||||
/^https:\/\/shabda\.ndre\.gr\/.*/i,
|
/^https:\/\/shabda\.ndre\.gr\/.*/i,
|
||||||
].some((regex) => regex.test(url));
|
].some((regex) => regex.test(url)),
|
||||||
},
|
|
||||||
handler: 'CacheFirst',
|
handler: 'CacheFirst',
|
||||||
options: {
|
options: {
|
||||||
cacheName: 'github-files',
|
cacheName: 'external-samples',
|
||||||
expiration: {
|
expiration: {
|
||||||
maxEntries: 5000,
|
maxEntries: 5000,
|
||||||
maxAgeSeconds: 60 * 60 * 24 * 30, // <== 14 days
|
maxAgeSeconds: 60 * 60 * 24 * 30, // <== 14 days
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue