Skip to content

Commit 3d675eb

Browse files
committed
Add force bypass cache flag for Soft Update / Update algorithm; set it for .update() method.
1 parent 66ff7c7 commit 3d675eb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

spec/service_worker/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ <h1><code>update()</code></h1>
422422
<li>Let <var>newestWorker</var> be the result of running <a href="#get-newest-worker-algorithm">Get Newest Worker</a> algorithm passing <var>registration</var> as its argument.</li>
423423
<li>If <var>newestWorker</var> is null, return a <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects">promise</a> rejected with an "<code><a href="http://heycam.github.io/webidl/#invalidstateerror">InvalidStateError</a></code>" exception.</li>
424424
<li>Set <var>registration</var>'s <a href="#dfn-registration-script-url">registering script url</a> to <var>newestWorker</var>'s <a href="#dfn-script-url">script url</a>.</li>
425-
<li>Let <var>p</var> be the result of running <a href="#update-algorithm">Update</a> algorithm, or its <a href="#dfn-processing-equivalence">equivalent</a>, passing the <a href="#dfn-service-worker-registration-interface-client">service worker client</a> <var>client</var> and <var>registration</var> as the arguments.</li>
425+
<li>Let <var>p</var> be the result of running <a href="#update-algorithm">Update</a> algorithm, or its <a href="#dfn-processing-equivalence">equivalent</a>, passing the <a href="#dfn-service-worker-registration-interface-client">service worker client</a> <var>client</var> and <var>registration</var> as the arguments with <em>force bypass cache flag</em> set.</li>
426426
<li>Return the result of <a href="http://www.w3.org/2001/tag/doc/promises-guide#transforming-by">transforming</a> <var>p</var> with:
427427
<ol>
428428
<li>A fulfillment handler that returns undefined.</li>
@@ -2453,6 +2453,7 @@ <h1>Update</h1>
24532453
<dt>Input</dt>
24542454
<dd><var>client</var>, a <a href="#dfn-service-worker-client">service worker client</a></dd>
24552455
<dd><var>registration</var>, a <a href="#dfn-service-worker-registration">service worker registration</a></dd>
2456+
<dd><em>force bypass cache flag</em>, an optional flag unset by default</dd>
24562457
<dt>Output</dt>
24572458
<dd><var>promise</var>, a <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects">promise</a></dd>
24582459
</dl>
@@ -2493,7 +2494,7 @@ <h1>Update</h1>
24932494
<li>Set <var>newestWorker</var> to the result of running <a href="#get-newest-worker-algorithm">Get Newest Worker</a> algorithm passing <var>registration</var> as the argument.</li>
24942495
<li>If <var>newestWorker</var> is not null and <var>registration</var>'s <a href="#dfn-last-update-time">last update time</a> is not null, then:
24952496
<ol>
2496-
<li>If the time difference in seconds calculated by the current time minus <var>registration</var>'s <a href="#dfn-last-update-time">last update time</a> is greater than <var>newestWorker</var>'s <a href="#dfn-max-age">max age</a>, set <var>r</var>'s <a href="https://fetch.spec.whatwg.org/#concept-request-cache-mode">cache mode</a> to "<code>reload</code>".</li>
2497+
<li>If the time difference in seconds calculated by the current time minus <var>registration</var>'s <a href="#dfn-last-update-time">last update time</a> is greater than <var>newestWorker</var>'s <a href="#dfn-max-age">max age</a>, or <em>force bypass cache flag</em> is set, set <var>r</var>'s <a href="https://fetch.spec.whatwg.org/#concept-request-cache-mode">cache mode</a> to "<code>reload</code>".</li>
24972498
</ol>
24982499
</li>
24992500
<li>Let <var>response</var> be the result of running <a href="https://fetch.spec.whatwg.org/#concept-fetch">fetch</a> using <var>r</var>.</li>
@@ -2601,6 +2602,7 @@ <h1>Soft Update</h1>
26012602
<dl>
26022603
<dt>Input</dt>
26032604
<dd><var>registration</var>, a <a href="#dfn-service-worker-registration">service worker registration</a></dd>
2605+
<dd><em>force bypass cache flag</em>, an optional flag unset by default</dd>
26042606
<dt>Output</dt>
26052607
<dd>None</dd>
26062608
</dl>
@@ -2611,7 +2613,7 @@ <h1>Soft Update</h1>
26112613
<li>Let <var>newestWorker</var> be the result of running <a href="#get-newest-worker-algorithm">Get Newest Worker</a> algorithm passing <var>registration</var> as its argument.</li>
26122614
<li>If <var>newestWorker</var> is null, abort these steps.</li>
26132615
<li>Set <var>registration</var>'s <a href="#dfn-registration-script-url">registering script url</a> to <var>newestWorker</var>'s <a href="#dfn-script-url">script url</a>.</li>
2614-
<li>Invoke <a href="#update-algorithm">Update</a> algorithm, or its <a href="#dfn-processing-equivalence">equivalent</a>, with <var>client</var>, <var>registration</var> as its argument.</li>
2616+
<li>Invoke <a href="#update-algorithm">Update</a> algorithm, or its <a href="#dfn-processing-equivalence">equivalent</a>, passing <var>client</var> and <var>registration</var> as its argument with <em>force bypass cache flag</em> set only if its own <em>force bypass cache flag</em> is set.</li>
26152617
</ol>
26162618
</spec-algorithm>
26172619
</spec-section>

0 commit comments

Comments
 (0)