this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fixes for SW caching

+8 -3
+8 -3
public/sw.js
··· 16 16 ({ request, sameOrigin }) => { 17 17 const isAsset = 18 18 request.destination === 'style' || request.destination === 'script'; 19 - const hasHash = /-[0-9a-f]{4,}\./i.test(request.url); 19 + const hasHash = /-[0-9a-z-]{4,}\./i.test(request.url); 20 20 return sameOrigin && isAsset && hasHash; 21 21 }, 22 22 new NetworkFirst({ 23 23 cacheName: 'assets', 24 24 networkTimeoutSeconds: 5, 25 25 plugins: [ 26 + new ExpirationPlugin({ 27 + maxEntries: 30, 28 + purgeOnQuotaError: true, 29 + }), 26 30 new CacheableResponsePlugin({ 27 31 statuses: [0, 200], 28 32 }), ··· 44 48 cacheName: 'remote-images', 45 49 plugins: [ 46 50 new ExpirationPlugin({ 47 - maxEntries: 50, 51 + maxEntries: 30, 48 52 purgeOnQuotaError: true, 49 53 }), 50 54 new CacheableResponsePlugin({ ··· 86 90 cacheName: 'api-extended', 87 91 plugins: [ 88 92 new ExpirationPlugin({ 89 - maxAgeSeconds: 24 * 60 * 60, // 1 day 93 + maxAgeSeconds: 12 * 60 * 60, // 12 hours 90 94 purgeOnQuotaError: true, 91 95 }), 92 96 new CacheableResponsePlugin({ ··· 128 132 networkTimeoutSeconds: 5, 129 133 plugins: [ 130 134 new ExpirationPlugin({ 135 + maxEntries: 30, 131 136 maxAgeSeconds: 5 * 60, // 5 minutes 132 137 purgeOnQuotaError: true, 133 138 }),