A way to specify a pattern of destination URLs to hit/skip SW
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- web-dev
Research direction
Start by reading the proposal and the related discussions in issues #1026 and #1373. Compare the allowlist header with the alternative and the Declarative Routing proposal, then determine whether the scope is narrowed to the first use case. Done means the behavior and relationship to existing proposals have community agreement.
Written by the indexing model from the issue text.
Description
We often hear a demand for specifying certain set of destination URLs to be intercepted by SW (e.g. #1026, #1373), and this is yet another (lightweight) proposal to address a subset of these using HTTP response headers (therefore it's ephemeral & scoped only to the current navigation).
Proposal: Service-Worker-Fetch-Scope header
- Allows website to return
Service-Worker-Fetch-Scope: <url-scope>HTTP response header to main resource requests, so that they can express what URLs should be hit by their SW for the service worker client that is instantiated by the main resource.<url-scope>can be either “none” or a scope URL. - When this is specified, the
service-workersmode of all subresource fetch requests from the service worker client that do NOT prefix-match the given scope
is set to”none”, i.e. this makes only the subresource requests that match the scope hit the Service Worker.
Examples:
- Example 1: A site returns
Service-Worker-Fetch-Scope: ‘/sw_cache/’to document requests so that only the subresources whose URL start with/sw_cache/are intercepted by the SW. - Example 2: A site starts to return
Service-Worker-Fetch-Scope: “none”after a certain period so that it can skip SW after that. (This could be slightly more efficient than scripting this in SWs as UA can skip routing requests entirely if UA can see it in NavPreload response before/during starting a SW) [EDIT: This use case is a bit hand-wavy, maybe we should focus on the first use-case only]
Alternative can be a header that works opposite, e.g. Service-Worker-Ignore-Fetch or something, while I've heard some sentimenet that allowlisting urls could be handier.
Technically this can be a subset of Declarative Routing proposal (#1373) and can potentially be subsumed by the proposal if we decide to implement it. Motivation of this proposal is to see if we can have a smaller, incremental iteration that can be easier to experiment with.
- Dominant language
- Bikeshed
- Stars
- 3.6k
- Forks
- 324
- Avg merge
- 14d 22h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from w3c/ServiceWorker
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
w3c/ServiceWorker#1391 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
w3c/ServiceWorker#1311 · 1 comment ·
-
apr-2017-f2f
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
w3c/ServiceWorker#1036 · 5 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
w3c/ServiceWorker#1846 ·
-
TPAC2026
Difficulty 3/5 1-2 days Newbie friendliness 35/100
w3c/ServiceWorker#1845 ·
All issues in w3c/ServiceWorker
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
tvOS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bvaughn/react-resizable-panels#751 · 1 comment ·
-
www.wiwo.de OpenN: AdGuard Browser Extension P3: Medium T: Annoyance
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
AdguardTeam/AdguardFilters#242026 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 92/100