-
Notifications
You must be signed in to change notification settings - Fork 6
Updated README.md to have the way to handle the no fetch handler case and the empty fetch handler case. #15
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4f389c9
Update README.md
yoshisatoyanagisawa e250f1e
Merge branch 'WICG:main' into main
yoshisatoyanagisawa 3dec6fa
Update README.md
yoshisatoyanagisawa 99f65db
Update README.md
yoshisatoyanagisawa 850f3c8
Update README.md
yoshisatoyanagisawa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -167,11 +167,24 @@ the original proposal. It is natural evolution to use `URLPattern` instead of U | |
| To allow third party services to use the API, the method can be called multiple times. | ||
| * URL related conditions are merged into `URLPattern`. | ||
|
|
||
| ### How does it work if there is no fetch handler? | ||
|
|
||
| For the "network" source, we can safely ignore the routes if there is no fetch handler, except for a debugging purpose. | ||
| In [the full picture](final-form.md), we introduce "cache", "fetch-event", and "race-network-and-fetch-handler" sources. | ||
| The "cache" source should look up a request from the cache storage even if there is no fetch handler. | ||
| Moreover, it does not need to run the fetch handlers regardless of cache hit or cache miss. | ||
| On the other hand, the "fetch-event" and "race-network-and-fetch-handler" sources run the fetch handlers. | ||
| `addRoutes()` should return a promise rejected with a *TypeError* if these sources are used while no fetch handlers are set. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good clarification 👍 |
||
|
|
||
| ### How does it work with [empty fetch listeners](https://github.com/yoshisatoyanagisawa/service-worker-skip-no-op-fetch-handler)? | ||
|
|
||
| If [all the fetch listeners are empty functions](https://w3c.github.io/ServiceWorker/#all-fetch-listeners-are-empty-algorithm), | ||
| routes may not be evaluated because routes expect some is handled by the fetch listeners while others are not. | ||
| If empty fetch listeners are set, routes should not be needed. | ||
| routes that only have the "network" source can be ignored, except for a debugging purpose. | ||
| Like the no fetch handler case above, the "cache" source should look up the cache storage regardless of the empty fetch handler or not. | ||
| However, unlike the no fetch handler case above, | ||
| `addRoutes()` should return a promise resolved with undefined for the "fetch-event" and "race-network-and-fetch-handler" sources | ||
| because the fetch handler exists. | ||
| During the navigation, the fetch handler may not need to run for these sources because they are empty. | ||
yoshisatoyanagisawa marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### How does it work with Navigation Preload? | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.