diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d603d4d..23cc2102 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to - ✨ Add comments feature to the editor #1330 - ✨(backend) Comments on text editor #1330 +### Changed + +- ⚡️(sw) stop to cache external resources likes videos #1655 + ### Fixed - ♿(frontend) improve accessibility: diff --git a/src/frontend/apps/impress/src/features/service-worker/service-worker.ts b/src/frontend/apps/impress/src/features/service-worker/service-worker.ts index 3e1f4357..da78fa24 100644 --- a/src/frontend/apps/impress/src/features/service-worker/service-worker.ts +++ b/src/frontend/apps/impress/src/features/service-worker/service-worker.ts @@ -157,33 +157,6 @@ registerRoute( }), ); -/** - * External urls cache strategy - */ -registerRoute( - ({ url }) => !url.href.includes(self.location.origin), - new NetworkFirst({ - cacheName: getCacheNameVersion('default-external'), - plugins: [ - new CacheableResponsePlugin({ statuses: [0, 200] }), - new ExpirationPlugin({ - maxAgeSeconds: 24 * 60 * 60 * DAYS_EXP, - }), - new OfflinePlugin(), - ], - }), - 'GET', -); - -/** - * Admin cache strategy - */ -registerRoute( - ({ url }) => - url.href.includes(self.location.origin) && url.href.includes('/admin/'), - new NetworkOnly(), -); - /** * Cache strategy static files images (images / svg) */ @@ -217,6 +190,24 @@ registerRoute( }), ); +/** + * External urls cache strategy + */ +registerRoute( + ({ url }) => !url.href.includes(self.location.origin), + new NetworkOnly(), + 'GET', +); + +/** + * Admin cache strategy + */ +registerRoute( + ({ url }) => + url.href.includes(self.location.origin) && url.href.includes('/admin/'), + new NetworkOnly(), +); + /** * Cache strategy static files (css, js, workers) */