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 local cache taking 1y to expire #738

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Fix local cache taking 1y to expire #738

merged 1 commit into from
Feb 21, 2024

Conversation

o-
Copy link
Member

@o- o- commented Feb 21, 2024

The serviceworker config in the generated sw.js contains the revision of cached pages. Client-side these revisions are used by Workbox to invalidate the local cache. The local cache strategy is precacheAndRoute. As long as sw.js is not refreshed the local cache is not invalidated and stale pages are served indefinetly.

The current policy for sw.js was 1 year, which probably was a bug, since there is also a shadowed no-cache config.

The serviceworker config in the generated sw.js contains the revision
of cached pages. Client-side these revisions are used by Workbox to
invalidate the local cache. The local cache strategy is
`precacheAndRoute`. As long as `sw.js` is not refreshed the local
cache is not invalidated and stale pages are served indefinetly.
@o- o- changed the title fFx local cache taking 1y to expire Fix local cache taking 1y to expire Feb 21, 2024
@camillobruni camillobruni self-assigned this Feb 21, 2024
@o- o- merged commit 25dcd97 into main Feb 21, 2024
4 checks passed
@o- o- deleted the fix-caching branch February 21, 2024 09:22
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.

2 participants