Skip to content

Instantly share code, notes, and snippets.

@jpawlyn
Created March 9, 2025 06:33
Show Gist options
  • Save jpawlyn/2ddf3b95b2bc74a55b12b73d8cadb66a to your computer and use it in GitHub Desktop.
Save jpawlyn/2ddf3b95b2bc74a55b12b73d8cadb66a to your computer and use it in GitHub Desktop.
const documentsStrategyOptions = {
cacheName: `documents-${CACHE_VERSION}`,
matchOptions: { ignoreVary: true },
plugins: [
new ExpirationPlugin({
maxEntries: 100
})
]
}
registerRoute(
({ request, url }) => !no_fallback_paths.includes(url.pathname) && (request.destination === 'document' ||
request.destination === ''),
new NetworkFirst(documentsStrategyOptions)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment