Skip to content

A platform for community discussion. Free, open, simple.

FIX: Service worker should cache only 200 requests (#21409)

Bianca Nenciu37cacf72ae47
diff --git a/app/assets/javascripts/service-worker.js.erb b/app/assets/javascripts/service-worker.js.erb
index 796670025f1..e16d8d9300c 100644
--- a/app/assets/javascripts/service-worker.js.erb
+++ b/app/assets/javascripts/service-worker.js.erb
@@ -81,6 +81,9 @@ if (cdnUrls.length > 0) {
credentials: 'omit'
},
plugins: [
+ new workbox.cacheableResponse.Plugin({
+ statuses: [200] // opaque responses will return status code '0'
+ }),
new workbox.expiration.Plugin({
maxAgeSeconds: 7* 24 * 60 * 60, // 7 days
maxEntries: 250,