feat: remove media cache

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2346>
environments/review-docs-fix-d-jlladr/deployments/17321
Kasper Seweryn 2023-01-30 13:54:03 +01:00 zatwierdzone przez Georg krause
rodzic 6b79b8e63a
commit 26f5f9b204
1 zmienionych plików z 1 dodań i 8 usunięć

Wyświetl plik

@ -1,7 +1,7 @@
/// <reference lib="webworker" />
import { cleanupOutdatedCaches, precacheAndRoute } from 'workbox-precaching'
import { NetworkFirst, StaleWhileRevalidate } from 'workbox-strategies'
import { NetworkFirst } from 'workbox-strategies'
import { ExpirationPlugin } from 'workbox-expiration'
import { registerRoute } from 'workbox-routing'
import { clientsClaim } from 'workbox-core'
@ -39,13 +39,6 @@ registerRoute(({ url }) => {
]
}))
// NOTE: Stale-While-Revalidate cache for album covers
// We're serving from cache if available and making a request
// in the background to update the cache for next request
registerRoute(({ url }) => {
return url.pathname.startsWith('/media')
}, new StaleWhileRevalidate())
// Precache all assets and add routes for them
// https://developer.chrome.com/docs/workbox/reference/workbox-precaching/#method-precacheAndRoute
precacheAndRoute(self.__WB_MANIFEST)