forked from Mirrors/elk
chore: switch web manifest handler to stale while revalidate handler
This commit is contained in:
parent
059502f3e2
commit
44d0e9c300
1 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@
|
|||
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
|
||||
import { NavigationRoute, registerRoute } from 'workbox-routing'
|
||||
import { CacheableResponsePlugin } from 'workbox-cacheable-response'
|
||||
import { NetworkFirst, StaleWhileRevalidate } from 'workbox-strategies'
|
||||
import { StaleWhileRevalidate } from 'workbox-strategies'
|
||||
import { ExpirationPlugin } from 'workbox-expiration'
|
||||
|
||||
import { onNotificationClick, onPush } from './web-push-notifications'
|
||||
|
@ -56,7 +56,7 @@ if (import.meta.env.PROD) {
|
|||
registerRoute(
|
||||
({ request, sameOrigin, url }) =>
|
||||
sameOrigin && request.destination === 'manifest' && url.pathname.startsWith('/manifest-'),
|
||||
new NetworkFirst({
|
||||
new StaleWhileRevalidate({
|
||||
cacheName: 'elk-webmanifest',
|
||||
// responses with a Vary: Accept-Encoding header
|
||||
matchOptions: {
|
||||
|
|
Loading…
Reference in a new issue