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: offline page precaching due to revision query parameter #511

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SebastienTainon
Copy link

Hello,
Since PR #386 was merged (and possibily a new version of workbox), the offlinePage option of the documentation does not seem to work.
This is because since this PR, the cache identifier for the offline page now contains a WB_REVISION_ query parameter:
image
When we do caches.match() it tries to get the page without the query parameter and so it gets nothing.

The workbox precaching module documentation page explains how to fix this:

Alternatively, if all you need is the precached Response object, you can call matchPrecache(), which will automatically use the correct cache key and search in the correct cache:

const response = await matchPrecache('/precached-file.html');

This is what I'm doing in this PR, since we already precache the offlinePage.

@SebastienTainon SebastienTainon changed the title Fix offline precaching due to revision query parameter Fix offline page precaching due to revision query parameter Mar 3, 2022
@SebastienTainon SebastienTainon changed the title Fix offline page precaching due to revision query parameter fix: offline page precaching due to revision query parameter Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant