Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pwa): add ignore vary to web manifests and emoji handlers #2453

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: switch web manifest handler to stale while revalidate handler
  • Loading branch information
userquin committed Nov 2, 2023
commit 44d0e9c300ec19c271cacd667815092bfd5f7e85
4 changes: 2 additions & 2 deletions service-worker/sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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: {
Expand Down