Skip to content

Commit c858a0d

Browse files
jakearchibaldjungkees
authored andcommitted
Ensuring no-cache is set on module imported scripts (#1027)
1 parent 7deb238 commit c858a0d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/index.bs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,19 +2472,22 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
24722472
: "<code>module</code>"
24732473
:: <a>Fetch a module worker script graph</a> given |job|’s <a lt="URL serializer">serialized</a> [=job/script url=], |job|’s [=job/client=], "<code>serviceworker</code>", "<code>omit</code>", and the to-be-created <a>environment settings object</a> for this service worker.
24742474

2475-
To [=fetching scripts/perform the fetch=] given |request|, run the following steps if the [=fetching scripts/is top-level=] flag is set:
2475+
To [=fetching scripts/perform the fetch=] given |request|, run the following steps:
24762476

2477-
1. Append \`<code>Service-Worker</code>\`/\`<code>script</code>\` to |request|'s [=request/header list=].
2478-
2479-
Note: See the definition of the Service-Worker header in Appendix B: Extended HTTP headers.
2480-
2481-
1. Set |request|'s <a>skip-service-worker flag</a> and |request|'s [=request/redirect mode=] to "<code>error</code>".
24822477
1. Set |request|'s [=request/cache mode=] to "<code>no-cache</code>" if any of the following are true:
24832478
* |registration|'s [=service worker registration/use cache=] is false.
24842479
* |job|'s [=force bypass cache flag=] is set.
24852480
* |newestWorker| is not null, and |registration|'s [=last update check time=] is not null and the time difference in seconds calculated by the current time minus |registration|’s [=last update check time=] is greater than 86400.
24862481

24872482
Note: Even if the cache mode is not set to "<code>no-cache</code>", the user agent obeys Cache-Control header's max-age value in the network layer to determine if it should bypass the browser cache.
2483+
2484+
1. Set |request|'s [=skip-service-worker flag=].
2485+
1. If the [=fetching scripts/is top-level=] flag is unset, then return the result of [=/fetching=] |request|.
2486+
1. Append \`<code>Service-Worker</code>\`/\`<code>script</code>\` to |request|'s [=request/header list=].
2487+
2488+
Note: See the definition of the Service-Worker header in Appendix B: Extended HTTP headers.
2489+
2490+
1. Set |request|'s [=request/redirect mode=] to "<code>error</code>".
24882491

24892492
1. [=/Fetch=] |request|, and asynchronously wait to run the remaining steps as part of fetch's <a>process response</a> for the [=/response=] |response|.
24902493
1. <a>Extract a MIME type</a> from the |response|'s [=response/header list=]. If this MIME type (ignoring parameters) is not one of <code>text/javascript</code>, <code>application/x-javascript</code>, and <code>application/javascript</code>, then:

0 commit comments

Comments
 (0)