diff --git a/app/assets/javascripts/service-worker.js.erb b/app/assets/javascripts/service-worker.js.erb index f7fb42821c4..3a320b0d83b 100644 --- a/app/assets/javascripts/service-worker.js.erb +++ b/app/assets/javascripts/service-worker.js.erb @@ -41,10 +41,10 @@ workbox.routing.registerRoute( new workbox.strategies.NetworkFirst({ // This will only use the cache when a network request fails cacheName: discourseCacheName, plugins: [ - new workbox.cacheableResponse.Plugin({ + new workbox.cacheableResponse.CacheableResponsePlugin({ statuses: [200] // opaque responses will return status code '0' }), // for s3 secure uploads signed urls - new workbox.expiration.Plugin({ + new workbox.expiration.ExpirationPlugin({ maxAgeSeconds: 7* 24 * 60 * 60, // 7 days maxEntries: 250, purgeOnQuotaError: true, // safe to automatically delete if exceeding the available storage @@ -93,10 +93,10 @@ if (cdnUrls.length > 0) { credentials: 'omit' }, plugins: [ - new workbox.cacheableResponse.Plugin({ + new workbox.cacheableResponse.CacheableResponsePlugin({ statuses: [200] // opaque responses will return status code '0' }), - new workbox.expiration.Plugin({ + new workbox.expiration.ExpirationPlugin({ maxAgeSeconds: 7* 24 * 60 * 60, // 7 days maxEntries: 250, purgeOnQuotaError: true, // safe to automatically delete if exceeding the available storage @@ -124,10 +124,10 @@ workbox.routing.registerRoute( new workbox.strategies.NetworkFirst({ // This will only use the cache when a network request fails cacheName: externalCacheName, plugins: [ - new workbox.cacheableResponse.Plugin({ + new workbox.cacheableResponse.CacheableResponsePlugin({ statuses: [200] // opaque responses will return status code '0' }), - new workbox.expiration.Plugin({ + new workbox.expiration.ExpirationPlugin({ maxAgeSeconds: 7* 24 * 60 * 60, // 7 days maxEntries: 250, purgeOnQuotaError: true, // safe to automatically delete if exceeding the available storage