From 575e3296138c7c78a3679bb083529f8625c83b2a Mon Sep 17 00:00:00 2001 From: Shay Cojocaru Date: Tue, 15 Oct 2019 23:59:29 +0300 Subject: [PATCH 1/4] fix: caching external symbols --- sw-precache-config.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sw-precache-config.js b/sw-precache-config.js index ec80f158d..95116183f 100644 --- a/sw-precache-config.js +++ b/sw-precache-config.js @@ -34,11 +34,29 @@ module.exports = { ], runtimeCaching: [ { - urlPattern: /\/images\//, + urlPattern: /\/symbols\/mulberry/, handler: 'cacheFirst', options: { cache: { - name: 'images-cache' + name: 'symbols-mulberry' + } + } + }, + { + urlPattern: /^https:\/\/globalsymbols\.com\/uploads/, + handler: 'cacheFirst', + options: { + cache: { + name: 'symbols-global' + } + } + }, + { + urlPattern: /^https:\/\/api\.arasaac\.org\/api/, + handler: 'cacheFirst', + options: { + cache: { + name: 'symbols-arasaac' } } } From fe7d4e5486b601b90fa1934e09ab5bee2c7ac507 Mon Sep 17 00:00:00 2001 From: Shay Cojocaru Date: Wed, 16 Oct 2019 01:05:05 +0300 Subject: [PATCH 2/4] fix: set 4mb size limit (from default 2mb) --- sw-precache-config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/sw-precache-config.js b/sw-precache-config.js index 95116183f..dbc2cafaa 100644 --- a/sw-precache-config.js +++ b/sw-precache-config.js @@ -32,6 +32,7 @@ module.exports = { 'build/static/**/!(*map*)', ...boardImages ], + maximumFileSizeToCacheInBytes: 4194304, runtimeCaching: [ { urlPattern: /\/symbols\/mulberry/, From f349b9fb60b865dca6fa8f5da5665df3b5733761 Mon Sep 17 00:00:00 2001 From: Shay Cojocaru Date: Tue, 22 Oct 2019 21:50:14 +0300 Subject: [PATCH 3/4] fix: remove globalsymbols/arasaac - SW limit 50mb --- sw-precache-config.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sw-precache-config.js b/sw-precache-config.js index dbc2cafaa..47b2ce960 100644 --- a/sw-precache-config.js +++ b/sw-precache-config.js @@ -42,24 +42,6 @@ module.exports = { name: 'symbols-mulberry' } } - }, - { - urlPattern: /^https:\/\/globalsymbols\.com\/uploads/, - handler: 'cacheFirst', - options: { - cache: { - name: 'symbols-global' - } - } - }, - { - urlPattern: /^https:\/\/api\.arasaac\.org\/api/, - handler: 'cacheFirst', - options: { - cache: { - name: 'symbols-arasaac' - } - } } ], dontCacheBustUrlsMatching: /\.\w{8}\./, From 0cac0c3a20353399853f3306f8a52354e3daa6a2 Mon Sep 17 00:00:00 2001 From: martin Date: Sat, 2 Nov 2019 12:34:21 -0300 Subject: [PATCH 4/4] add arasaac symbols --- sw-precache-config.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sw-precache-config.js b/sw-precache-config.js index 47b2ce960..76e749f8d 100644 --- a/sw-precache-config.js +++ b/sw-precache-config.js @@ -42,6 +42,24 @@ module.exports = { name: 'symbols-mulberry' } } + }, + { + urlPattern: /\/symbols\/arasaac/, + handler: 'cacheFirst', + options: { + cache: { + name: 'symbols-arasaac' + } + } + }, + { + urlPattern: /\/symbols\/cboard/, + handler: 'cacheFirst', + options: { + cache: { + name: 'symbols-cboard' + } + } } ], dontCacheBustUrlsMatching: /\.\w{8}\./,