[html5] r7136 - [giow] (0) Add a feature to appcache to make it possible to mark a cache as pref [...]

whatwg at whatwg.org whatwg at whatwg.org
Thu Jun 14 15:48:13 PDT 2012


Author: ianh
Date: 2012-06-14 15:48:12 -0700 (Thu, 14 Jun 2012)
New Revision: 7136

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Add a feature to appcache to make it possible to mark a cache as preferring online resources than cached resources.
Affected topics: HTML, Offline Web Applications

Modified: complete.html
===================================================================
--- complete.html	2012-06-14 20:56:53 UTC (rev 7135)
+++ complete.html	2012-06-14 22:48:12 UTC (rev 7136)
@@ -1542,6 +1542,7 @@
    <li>Some predefined <a href=#mdvocabs>Microdata vocabularies</a>.</li>
    <li>The <code><a href=#the-data-element>data</a></code> element for marking up machine-readable data.</li><!--DATA--><!--FORK-->
    <li>The <code title=scheme-http+aes><a href=#http+aes-scheme>http+aes:</a></code> and <code title=scheme-http+aes><a href=#http+aes-scheme>https+aes:</a></code> schemes.</li><!--FORK-->
+   <li>The <a href=#application-cache>application cache</a> feature's <a href=#concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online>prefer-online</a> mode.</li><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
   </ul><!--
   <p>Features that are part of the WHATWG HTML Living Standard
   specification but that are currently published as separate
@@ -36507,7 +36508,7 @@
 
   <!-- this is filler to make sure the TCP packet boundary doesn't fall in the middle of one of the NCRs below -->
   <!-- (because otherwise the parser in anolis screws it up) -->
-  <p><img alt="The top of the em square is roughly at the top of the glyphs in a font, the hanging baseline is where some glyphs like आ are anchored, the middle is half-way between the top of the em square and the bottom of the em square, the alphabetic baseline is where characters like " height=300 src=http://images.whatwg.org/baselines.png width=738>x00C1;, ÿ, f, and Ω are anchored, the ideographic baseline is where glyphs like 私 and 達 are anchored, and the bottom of the em square is roughly at the bottom of the glyphs in a font. The top and bottom of the bounding box can be far from these baselines, due to glyphs extending far outside the em square."></p>
+  <p><img alt="The top of the em square is roughly at the top of the glyphs in a font, the hanging baseline is where some glyphs like आ are anchored, the middle is half-way between the top of the em square and the bottom of the em square, the alphabetic baseline is where characters like Á, ÿ, f, and Ω are anchored, the ideographic baseline is where glyphs like 私 and 達 are anchored, and the bottom of the em square is roughly at the bottom of the glyphs in a font. The top and bottom of the bounding box can be far from these baselines, due to glyphs extending far outside the em square." height=300 src=http://images.whatwg.org/baselines.png width=738></p>
 
   <p>The keywords map to these alignment points as follows:</p>
 
@@ -67795,9 +67796,10 @@
     application caches</a> that are identified by a URL with the
     <a href=#same-origin>same origin</a> as the URL in question, and that have
     this URL as one of their entries, excluding entries marked as
-    <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, then get
-    the resource from the <a href=#concept-appcache-selection title=concept-appcache-selection>most appropriate application
-    cache</a> of those that match.</p>
+    <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, and whose
+    <a href=#concept-appcache-mode title=concept-appcache-mode>mode</a> is <a href=#concept-appcache-mode-fast title=concept-appcache-mode-fast>fast</a>, then get the
+    resource from the <a href=#concept-appcache-selection title=concept-appcache-selection>most
+    appropriate application cache</a> of those that match.</p>
 
     <p class=example>For example, imagine an HTML page with an
     associated application cache displaying an image and a form, where
@@ -67921,8 +67923,43 @@
 
    </li>
 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
    <li>
 
+    <p>If the resource was not fetched from an <a href=#application-cache>application
+    cache</a>, and was to be fetched using HTTP GET <a href=#concept-http-equivalent-get title=concept-http-equivalent-get>or equivalent</a>, and
+
+    there are <a href=#relevant-application-cache title="relevant application cache">relevant
+    application caches</a> that are identified by a URL with the
+    <a href=#same-origin>same origin</a> as the URL in question, and that have
+    this URL as one of their entries, excluding entries marked as
+    <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, and whose
+    <a href=#concept-appcache-mode title=concept-appcache-mode>mode</a> is <a href=#concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online>prefer-online</a>,
+    and the user didn't cancel the navigation attempt during the
+    earlier step, and the navigation attempt failed (e.g. the server
+    returned a 4xx or 5xx status code <a href=#concept-http-equivalent-codes title=concept-http-equivalent-codes>or equivalent</a>, or
+    there was a DNS error), then:</p>
+
+    <p>Let <var title="">candidate</var> be the resource identified by
+    the URL in question from the <a href=#concept-appcache-selection title=concept-appcache-selection>most appropriate application
+    cache</a> of those that match.</p> <!-- note that a redirect
+    can never reach this point as it is handled earlier, meaning that
+    a captive portal captures URLs in "prefer-online" caches and you
+    can't ever get to the cached resource of a prefer-online cache if
+    you have a captive portal -->
+
+    <p>If <var title="">candidate</var> is not marked as <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, then the user
+    agent must discard the failed load and instead continue along
+    these steps using <var title="">candidate</var> as the resource.
+    The user agent may indicate to the user that the original page
+    load failed, and that the page used was a previously cached
+    resource.</p>
+
+   </li>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
+   <li>
+
     <p><i>Resource handling</i>: If the resource's out-of-band
     metadata (e.g. HTTP headers), not counting any <a href=#content-type title=Content-Type>type information</a> (such as the
     Content-Type HTTP header), requires some sort of processing that
@@ -69392,7 +69429,7 @@
      <td> The user agent will try fetching the files again momentarily.
   </table><div class=impl>
 
-  <h4 id=appcache><span class=secno>6.7.2 </span>Application caches</h4>
+  <h4 id=appcache><span class=secno>6.7.2 </span>Application caches</h4> <!--APPCACHE-->
 
   <p>An <dfn id=application-cache>application cache</dfn> is a set of cached resources
   consisting of:</p>
@@ -69486,6 +69523,21 @@
 
    </li>
 
+   <li>
+
+    <p>A <dfn id=concept-appcache-mode title=concept-appcache-mode>cache mode flag</dfn>,
+    which is 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    either
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    in the <dfn id=concept-appcache-mode-fast title=concept-appcache-mode-fast><i>fast</i></dfn>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    state or the <dfn id=concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online><i>prefer-online</i></dfn>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    state.</p>
+
+   </li>
+
   </ul><p>Each <a href=#application-cache>application cache</a> has a <dfn id=concept-appcache-completeness title=concept-appcache-completeness>completeness flag</dfn>, which is
   either <i>complete</i> or <i>incomplete</i>.</p>
 
@@ -69734,7 +69786,8 @@
 
    <dt>A section header
    <dd>
-    <p>Section headers change the current section. There are three
+
+    <p>Section headers change the current section. There are four
     possible section headers:
 
     <dl><dt><code>CACHE:</code>
@@ -69746,6 +69799,11 @@
      <dt><code>NETWORK:</code>
      <dd>Switches to the <dfn id=concept-appcache-manifest-network title=concept-appcache-manifest-network>online whitelist section</dfn>.
 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+     <dt><code>SETTINGS:</code>
+     <dd>Switches to the <dfn id=concept-appcache-manifest-settings title=concept-appcache-manifest-settings>settings section</dfn>.
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
     </dl><p>Section header lines must consist of zero or more U+0020 SPACE
     and U+0009 CHARACTER TABULATION (tab) characters, followed by one
     of the names above (including the U+003A COLON character (:))
@@ -69786,6 +69844,27 @@
     and then zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION
     (tab) characters.</p>
 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    <p>When the current section is the <a href=#concept-appcache-manifest-settings title=concept-appcache-manifest-settings>settings
+    section</a>, data lines must consist of zero or more U+0020
+    SPACE and U+0009 CHARACTER TABULATION (tab) characters, a <a href=#concept-appcache-manifest-setting title=concept-appcache-manifest-setting>setting</a>, and then
+    zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION (tab)
+    characters.</p>
+
+    <p>Currently only one <dfn id=concept-appcache-manifest-setting title=concept-appcache-manifest-setting>setting</dfn> is
+    defined:</p>
+
+    <dl><dt>The cache mode setting</dt>
+
+     <dd>This consists of the string "<code title="">prefer-online</code>". It sets the <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode</a> to <a href=#concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online>prefer-online</a>.
+     (The <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode</a>
+     defaults to <a href=#concept-appcache-mode-fast title=concept-appcache-mode-fast>fast</a>.)</dd>
+
+    </dl><p>Within a <a href=#concept-appcache-manifest-settings title=concept-appcache-manifest-settings>settings
+    section</a>, each <a href=#concept-appcache-manifest-setting title=concept-appcache-manifest-setting>setting</a> must
+    occur no more than once.</p>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
 <!--
     <p class="note">The URLs in data lines can't be empty strings,
     since those would be relative URLs to the manifest itself. Such
@@ -69870,6 +69949,8 @@
    <li><p>Let <var title="">online whitelist wildcard flag</var> be <i title="">blocking</i>. <!--
    concept-appcache-onlinewhitelist-wildcard --></li>
 
+   <li><p>Let <var title="">cache mode flag</var> be <i title="">fast</i>. <!-- concept-appcache-mode-fast --></li>
+
    <li><p>Let <var title="">input</var> be the decoded text of the
    manifest's byte stream.</li>
 
@@ -69936,6 +70017,12 @@
    "NETWORK" followed by a U+003A COLON character (:)), then set <var title="">mode</var> to "online whitelist" and jump back to the step
    labeled "start of line".</li>
 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+   <li><p>If <var title="">line</var> equals "SETTINGS:" (the word
+   "SETTINGS" followed by a U+003A COLON character (:)), then set <var title="">mode</var> to "settings" and jump back to the step labeled
+   "start of line".</li>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
    <li><p>If <var title="">line</var> ends with a U+003A COLON
    character (:), then set <var title="">mode</var> to "unknown" and
    jump back to the step labeled "start of line".</li>
@@ -70062,6 +70149,22 @@
 
      </dd>
 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+     <dt>If <var title="">mode</var> is "settings"</dt>
+
+     <dd>
+
+      <p>If <var title="">tokens</var> contains a single token, and
+      that token is a <a href=#case-sensitive>case-sensitive</a> match for the string
+      "<code title="">prefer-online</code>", then set <var title="">cache mode flag</var> to <i title="">prefer-online</i>
+      and jump back to the step labeled "start of line".</p>
+
+      <p>Otherwise, the line is an unsupported setting: do nothing;
+      the line is ignored.</p>
+
+     </dd>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
      <dt>If <var title="">mode</var> is "unknown"</dt>
 
      <dd>
@@ -70077,8 +70180,9 @@
    reached.)</li>
 
    <li><p>Return the <var title="">explicit URLs</var> list, the <var title="">fallback URLs</var> mapping, the <var title="">online
-   whitelist namespaces</var>, and the <var title="">online whitelist
-   wildcard flag</var>.</li>
+   whitelist namespaces</var>, the <var title="">online whitelist
+   wildcard flag</var>, and the <var title="">cache mode
+   flag</var>.</li>
 
   </ol><div class=note>
 
@@ -70273,8 +70377,8 @@
     obtaining a list of <a href=#concept-appcache-explicit title=concept-appcache-explicit>explicit entries</a>, <a href=#concept-appcache-fallback title=concept-appcache-fallback>fallback entries</a> and the
     <a href=#concept-appcache-fallback-ns title=concept-appcache-fallback-ns>fallback
     namespaces</a> that map to them, entries for the <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online whitelist</a>,
-    and a value for the <a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
-    wildcard flag</a>.</p>
+    and values for the <a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
+    wildcard flag</a> and the <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode flag</a>.</p>
 
     <p class=note>The <a href=#mime-type>MIME type</a> of the resource is
     ignored — it is assumed to be
@@ -70666,6 +70770,8 @@
    <li><p>Store the value of the new <a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
    wildcard flag</a> in <var title="">new cache</var>.</li>
 
+   <li><p>Store the value of the new <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode flag</a> in <var title="">new cache</var>.</li>
+
    <li>
 
     <p>For each entry in <var title="">cache group</var>'s <a href=#concept-appcache-pending-masters title=concept-appcache-pending-masters>list of pending master
@@ -70968,6 +71074,15 @@
     the <a href=#concept-appcache-master title=concept-appcache-master>master</a>
     resource.</p>
 
+    <p>If there are <a href=#relevant-application-cache title="relevant application cache">relevant
+    application caches</a> that are identified by a URL with the
+    <a href=#same-origin>same origin</a> as the URL of <var title="">document</var>, and that have this URL as one of their
+    entries, excluding entries marked as <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, then the user
+    agent should use the <a href=#concept-appcache-selection title=concept-appcache-selection>most
+    appropriate application cache</a> of those that match as an
+    HTTP cache for any subresource loads. User agents may also have
+    other caches in place that are also honored.</p>
+
    </dd>
 
 

Modified: index
===================================================================
--- index	2012-06-14 20:56:53 UTC (rev 7135)
+++ index	2012-06-14 22:48:12 UTC (rev 7136)
@@ -1542,6 +1542,7 @@
    <li>Some predefined <a href=#mdvocabs>Microdata vocabularies</a>.</li>
    <li>The <code><a href=#the-data-element>data</a></code> element for marking up machine-readable data.</li><!--DATA--><!--FORK-->
    <li>The <code title=scheme-http+aes><a href=#http+aes-scheme>http+aes:</a></code> and <code title=scheme-http+aes><a href=#http+aes-scheme>https+aes:</a></code> schemes.</li><!--FORK-->
+   <li>The <a href=#application-cache>application cache</a> feature's <a href=#concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online>prefer-online</a> mode.</li><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
   </ul><!--
   <p>Features that are part of the WHATWG HTML Living Standard
   specification but that are currently published as separate
@@ -36507,7 +36508,7 @@
 
   <!-- this is filler to make sure the TCP packet boundary doesn't fall in the middle of one of the NCRs below -->
   <!-- (because otherwise the parser in anolis screws it up) -->
-  <p><img alt="The top of the em square is roughly at the top of the glyphs in a font, the hanging baseline is where some glyphs like आ are anchored, the middle is half-way between the top of the em square and the bottom of the em square, the alphabetic baseline is where characters like " height=300 src=http://images.whatwg.org/baselines.png width=738>x00C1;, ÿ, f, and Ω are anchored, the ideographic baseline is where glyphs like 私 and 達 are anchored, and the bottom of the em square is roughly at the bottom of the glyphs in a font. The top and bottom of the bounding box can be far from these baselines, due to glyphs extending far outside the em square."></p>
+  <p><img alt="The top of the em square is roughly at the top of the glyphs in a font, the hanging baseline is where some glyphs like आ are anchored, the middle is half-way between the top of the em square and the bottom of the em square, the alphabetic baseline is where characters like Á, ÿ, f, and Ω are anchored, the ideographic baseline is where glyphs like 私 and 達 are anchored, and the bottom of the em square is roughly at the bottom of the glyphs in a font. The top and bottom of the bounding box can be far from these baselines, due to glyphs extending far outside the em square." height=300 src=http://images.whatwg.org/baselines.png width=738></p>
 
   <p>The keywords map to these alignment points as follows:</p>
 
@@ -67795,9 +67796,10 @@
     application caches</a> that are identified by a URL with the
     <a href=#same-origin>same origin</a> as the URL in question, and that have
     this URL as one of their entries, excluding entries marked as
-    <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, then get
-    the resource from the <a href=#concept-appcache-selection title=concept-appcache-selection>most appropriate application
-    cache</a> of those that match.</p>
+    <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, and whose
+    <a href=#concept-appcache-mode title=concept-appcache-mode>mode</a> is <a href=#concept-appcache-mode-fast title=concept-appcache-mode-fast>fast</a>, then get the
+    resource from the <a href=#concept-appcache-selection title=concept-appcache-selection>most
+    appropriate application cache</a> of those that match.</p>
 
     <p class=example>For example, imagine an HTML page with an
     associated application cache displaying an image and a form, where
@@ -67921,8 +67923,43 @@
 
    </li>
 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
    <li>
 
+    <p>If the resource was not fetched from an <a href=#application-cache>application
+    cache</a>, and was to be fetched using HTTP GET <a href=#concept-http-equivalent-get title=concept-http-equivalent-get>or equivalent</a>, and
+
+    there are <a href=#relevant-application-cache title="relevant application cache">relevant
+    application caches</a> that are identified by a URL with the
+    <a href=#same-origin>same origin</a> as the URL in question, and that have
+    this URL as one of their entries, excluding entries marked as
+    <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, and whose
+    <a href=#concept-appcache-mode title=concept-appcache-mode>mode</a> is <a href=#concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online>prefer-online</a>,
+    and the user didn't cancel the navigation attempt during the
+    earlier step, and the navigation attempt failed (e.g. the server
+    returned a 4xx or 5xx status code <a href=#concept-http-equivalent-codes title=concept-http-equivalent-codes>or equivalent</a>, or
+    there was a DNS error), then:</p>
+
+    <p>Let <var title="">candidate</var> be the resource identified by
+    the URL in question from the <a href=#concept-appcache-selection title=concept-appcache-selection>most appropriate application
+    cache</a> of those that match.</p> <!-- note that a redirect
+    can never reach this point as it is handled earlier, meaning that
+    a captive portal captures URLs in "prefer-online" caches and you
+    can't ever get to the cached resource of a prefer-online cache if
+    you have a captive portal -->
+
+    <p>If <var title="">candidate</var> is not marked as <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, then the user
+    agent must discard the failed load and instead continue along
+    these steps using <var title="">candidate</var> as the resource.
+    The user agent may indicate to the user that the original page
+    load failed, and that the page used was a previously cached
+    resource.</p>
+
+   </li>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
+   <li>
+
     <p><i>Resource handling</i>: If the resource's out-of-band
     metadata (e.g. HTTP headers), not counting any <a href=#content-type title=Content-Type>type information</a> (such as the
     Content-Type HTTP header), requires some sort of processing that
@@ -69392,7 +69429,7 @@
      <td> The user agent will try fetching the files again momentarily.
   </table><div class=impl>
 
-  <h4 id=appcache><span class=secno>6.7.2 </span>Application caches</h4>
+  <h4 id=appcache><span class=secno>6.7.2 </span>Application caches</h4> <!--APPCACHE-->
 
   <p>An <dfn id=application-cache>application cache</dfn> is a set of cached resources
   consisting of:</p>
@@ -69486,6 +69523,21 @@
 
    </li>
 
+   <li>
+
+    <p>A <dfn id=concept-appcache-mode title=concept-appcache-mode>cache mode flag</dfn>,
+    which is 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    either
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    in the <dfn id=concept-appcache-mode-fast title=concept-appcache-mode-fast><i>fast</i></dfn>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    state or the <dfn id=concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online><i>prefer-online</i></dfn>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    state.</p>
+
+   </li>
+
   </ul><p>Each <a href=#application-cache>application cache</a> has a <dfn id=concept-appcache-completeness title=concept-appcache-completeness>completeness flag</dfn>, which is
   either <i>complete</i> or <i>incomplete</i>.</p>
 
@@ -69734,7 +69786,8 @@
 
    <dt>A section header
    <dd>
-    <p>Section headers change the current section. There are three
+
+    <p>Section headers change the current section. There are four
     possible section headers:
 
     <dl><dt><code>CACHE:</code>
@@ -69746,6 +69799,11 @@
      <dt><code>NETWORK:</code>
      <dd>Switches to the <dfn id=concept-appcache-manifest-network title=concept-appcache-manifest-network>online whitelist section</dfn>.
 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+     <dt><code>SETTINGS:</code>
+     <dd>Switches to the <dfn id=concept-appcache-manifest-settings title=concept-appcache-manifest-settings>settings section</dfn>.
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
     </dl><p>Section header lines must consist of zero or more U+0020 SPACE
     and U+0009 CHARACTER TABULATION (tab) characters, followed by one
     of the names above (including the U+003A COLON character (:))
@@ -69786,6 +69844,27 @@
     and then zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION
     (tab) characters.</p>
 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    <p>When the current section is the <a href=#concept-appcache-manifest-settings title=concept-appcache-manifest-settings>settings
+    section</a>, data lines must consist of zero or more U+0020
+    SPACE and U+0009 CHARACTER TABULATION (tab) characters, a <a href=#concept-appcache-manifest-setting title=concept-appcache-manifest-setting>setting</a>, and then
+    zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION (tab)
+    characters.</p>
+
+    <p>Currently only one <dfn id=concept-appcache-manifest-setting title=concept-appcache-manifest-setting>setting</dfn> is
+    defined:</p>
+
+    <dl><dt>The cache mode setting</dt>
+
+     <dd>This consists of the string "<code title="">prefer-online</code>". It sets the <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode</a> to <a href=#concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online>prefer-online</a>.
+     (The <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode</a>
+     defaults to <a href=#concept-appcache-mode-fast title=concept-appcache-mode-fast>fast</a>.)</dd>
+
+    </dl><p>Within a <a href=#concept-appcache-manifest-settings title=concept-appcache-manifest-settings>settings
+    section</a>, each <a href=#concept-appcache-manifest-setting title=concept-appcache-manifest-setting>setting</a> must
+    occur no more than once.</p>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
 <!--
     <p class="note">The URLs in data lines can't be empty strings,
     since those would be relative URLs to the manifest itself. Such
@@ -69870,6 +69949,8 @@
    <li><p>Let <var title="">online whitelist wildcard flag</var> be <i title="">blocking</i>. <!--
    concept-appcache-onlinewhitelist-wildcard --></li>
 
+   <li><p>Let <var title="">cache mode flag</var> be <i title="">fast</i>. <!-- concept-appcache-mode-fast --></li>
+
    <li><p>Let <var title="">input</var> be the decoded text of the
    manifest's byte stream.</li>
 
@@ -69936,6 +70017,12 @@
    "NETWORK" followed by a U+003A COLON character (:)), then set <var title="">mode</var> to "online whitelist" and jump back to the step
    labeled "start of line".</li>
 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+   <li><p>If <var title="">line</var> equals "SETTINGS:" (the word
+   "SETTINGS" followed by a U+003A COLON character (:)), then set <var title="">mode</var> to "settings" and jump back to the step labeled
+   "start of line".</li>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
    <li><p>If <var title="">line</var> ends with a U+003A COLON
    character (:), then set <var title="">mode</var> to "unknown" and
    jump back to the step labeled "start of line".</li>
@@ -70062,6 +70149,22 @@
 
      </dd>
 
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+     <dt>If <var title="">mode</var> is "settings"</dt>
+
+     <dd>
+
+      <p>If <var title="">tokens</var> contains a single token, and
+      that token is a <a href=#case-sensitive>case-sensitive</a> match for the string
+      "<code title="">prefer-online</code>", then set <var title="">cache mode flag</var> to <i title="">prefer-online</i>
+      and jump back to the step labeled "start of line".</p>
+
+      <p>Otherwise, the line is an unsupported setting: do nothing;
+      the line is ignored.</p>
+
+     </dd>
+<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
      <dt>If <var title="">mode</var> is "unknown"</dt>
 
      <dd>
@@ -70077,8 +70180,9 @@
    reached.)</li>
 
    <li><p>Return the <var title="">explicit URLs</var> list, the <var title="">fallback URLs</var> mapping, the <var title="">online
-   whitelist namespaces</var>, and the <var title="">online whitelist
-   wildcard flag</var>.</li>
+   whitelist namespaces</var>, the <var title="">online whitelist
+   wildcard flag</var>, and the <var title="">cache mode
+   flag</var>.</li>
 
   </ol><div class=note>
 
@@ -70273,8 +70377,8 @@
     obtaining a list of <a href=#concept-appcache-explicit title=concept-appcache-explicit>explicit entries</a>, <a href=#concept-appcache-fallback title=concept-appcache-fallback>fallback entries</a> and the
     <a href=#concept-appcache-fallback-ns title=concept-appcache-fallback-ns>fallback
     namespaces</a> that map to them, entries for the <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online whitelist</a>,
-    and a value for the <a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
-    wildcard flag</a>.</p>
+    and values for the <a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
+    wildcard flag</a> and the <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode flag</a>.</p>
 
     <p class=note>The <a href=#mime-type>MIME type</a> of the resource is
     ignored — it is assumed to be
@@ -70666,6 +70770,8 @@
    <li><p>Store the value of the new <a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
    wildcard flag</a> in <var title="">new cache</var>.</li>
 
+   <li><p>Store the value of the new <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode flag</a> in <var title="">new cache</var>.</li>
+
    <li>
 
     <p>For each entry in <var title="">cache group</var>'s <a href=#concept-appcache-pending-masters title=concept-appcache-pending-masters>list of pending master
@@ -70968,6 +71074,15 @@
     the <a href=#concept-appcache-master title=concept-appcache-master>master</a>
     resource.</p>
 
+    <p>If there are <a href=#relevant-application-cache title="relevant application cache">relevant
+    application caches</a> that are identified by a URL with the
+    <a href=#same-origin>same origin</a> as the URL of <var title="">document</var>, and that have this URL as one of their
+    entries, excluding entries marked as <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, then the user
+    agent should use the <a href=#concept-appcache-selection title=concept-appcache-selection>most
+    appropriate application cache</a> of those that match as an
+    HTTP cache for any subresource loads. User agents may also have
+    other caches in place that are also honored.</p>
+
    </dd>
 
 

Modified: source
===================================================================
--- source	2012-06-14 20:56:53 UTC (rev 7135)
+++ source	2012-06-14 22:48:12 UTC (rev 7136)
@@ -272,6 +272,7 @@
    <li>Some predefined <a href="#mdvocabs">Microdata vocabularies</a>.</li>
    <li>The <code>data</code> element for marking up machine-readable data.</li><!--DATA--><!--FORK-->
    <li>The <code title="scheme-http+aes">http+aes:</code> and <code title="scheme-http+aes">https+aes:</code> schemes.</li><!--FORK-->
+   <li>The <span>application cache</span> feature's <span title="concept-appcache-mode-prefer-online">prefer-online</span> mode.</li><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
   </ul>
 
 <!--
@@ -79415,10 +79416,11 @@
     application caches</span> that are identified by a URL with the
     <span>same origin</span> as the URL in question, and that have
     this URL as one of their entries, excluding entries marked as
-    <span title="concept-appcache-foreign">foreign</span>, then get
-    the resource from the <span
-    title="concept-appcache-selection">most appropriate application
-    cache</span> of those that match.</p>
+    <span title="concept-appcache-foreign">foreign</span>, and whose
+    <span title="concept-appcache-mode">mode</span> is <span
+    title="concept-appcache-mode-fast">fast</span>, then get the
+    resource from the <span title="concept-appcache-selection">most
+    appropriate application cache</span> of those that match.</p>
 
     <p class="example">For example, imagine an HTML page with an
     associated application cache displaying an image and a form, where
@@ -79551,8 +79553,48 @@
 
    </li>
 
+<!--END w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
    <li>
 
+    <p>If the resource was not fetched from an <span>application
+    cache</span>, and was to be fetched using HTTP GET <span
+    title="concept-http-equivalent-get">or equivalent</span>, and
+
+    there are <span title="relevant application cache">relevant
+    application caches</span> that are identified by a URL with the
+    <span>same origin</span> as the URL in question, and that have
+    this URL as one of their entries, excluding entries marked as
+    <span title="concept-appcache-foreign">foreign</span>, and whose
+    <span title="concept-appcache-mode">mode</span> is <span
+    title="concept-appcache-mode-prefer-online">prefer-online</span>,
+    and the user didn't cancel the navigation attempt during the
+    earlier step, and the navigation attempt failed (e.g. the server
+    returned a 4xx or 5xx status code <span
+    title="concept-http-equivalent-codes">or equivalent</span>, or
+    there was a DNS error), then:</p>
+
+    <p>Let <var title="">candidate</var> be the resource identified by
+    the URL in question from the <span
+    title="concept-appcache-selection">most appropriate application
+    cache</span> of those that match.</p> <!-- note that a redirect
+    can never reach this point as it is handled earlier, meaning that
+    a captive portal captures URLs in "prefer-online" caches and you
+    can't ever get to the cached resource of a prefer-online cache if
+    you have a captive portal -->
+
+    <p>If <var title="">candidate</var> is not marked as <span
+    title="concept-appcache-foreign">foreign</span>, then the user
+    agent must discard the failed load and instead continue along
+    these steps using <var title="">candidate</var> as the resource.
+    The user agent may indicate to the user that the original page
+    load failed, and that the page used was a previously cached
+    resource.</p>
+
+   </li>
+<!--START w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
+   <li>
+
     <p><i>Resource handling</i>: If the resource's out-of-band
     metadata (e.g. HTTP headers), not counting any <span
     title="Content-Type">type information</span> (such as the
@@ -81232,7 +81274,7 @@
 
   <div class="impl">
 
-  <h4 id="appcache">Application caches</h4>
+  <h4 id="appcache">Application caches</h4> <!--APPCACHE-->
 
   <p>An <dfn>application cache</dfn> is a set of cached resources
   consisting of:</p>
@@ -81348,6 +81390,22 @@
 
    </li>
 
+   <li>
+
+    <p>A <dfn title="concept-appcache-mode">cache mode flag</dfn>,
+    which is 
+<!--END w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    either
+<!--START w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    in the <dfn title="concept-appcache-mode-fast"><i>fast</i></dfn>
+<!--END w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    state or the <dfn
+    title="concept-appcache-mode-prefer-online"><i>prefer-online</i></dfn>
+<!--START w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    state.</p>
+
+   </li>
+
   </ul>
 
   <p>Each <span>application cache</span> has a <dfn
@@ -81636,7 +81694,8 @@
 
    <dt>A section header
    <dd>
-    <p>Section headers change the current section. There are three
+
+    <p>Section headers change the current section. There are four
     possible section headers:
 
     <dl>
@@ -81650,6 +81709,11 @@
      <dt><code>NETWORK:</code>
      <dd>Switches to the <dfn title="concept-appcache-manifest-network">online whitelist section</dfn>.
 
+<!--END w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+     <dt><code>SETTINGS:</code>
+     <dd>Switches to the <dfn title="concept-appcache-manifest-settings">settings section</dfn>.
+<!--START w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
     </dl>
 
     <p>Section header lines must consist of zero or more U+0020 SPACE
@@ -81695,6 +81759,40 @@
     and then zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION
     (tab) characters.</p>
 
+<!--END w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+    <p>When the current section is the <span
+    title="concept-appcache-manifest-settings">settings
+    section</span>, data lines must consist of zero or more U+0020
+    SPACE and U+0009 CHARACTER TABULATION (tab) characters, a <span
+    title="concept-appcache-manifest-setting">setting</span>, and then
+    zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION (tab)
+    characters.</p>
+
+    <p>Currently only one <dfn
+    title="concept-appcache-manifest-setting">setting</dfn> is
+    defined:</p>
+
+    <dl>
+
+     <dt>The cache mode setting</dt>
+
+     <dd>This consists of the string "<code
+     title="">prefer-online</code>". It sets the <span
+     title="concept-appcache-mode">cache mode</span> to <span
+     title="concept-appcache-mode-prefer-online">prefer-online</span>.
+     (The <span title="concept-appcache-mode">cache mode</span>
+     defaults to <span
+     title="concept-appcache-mode-fast">fast</span>.)</dd>
+
+    </dl>
+
+    <p>Within a <span
+    title="concept-appcache-manifest-settings">settings
+    section</span>, each <span
+    title="concept-appcache-manifest-setting">setting</span> must
+    occur no more than once.</p>
+<!--START w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
 <!--
     <p class="note">The URLs in data lines can't be empty strings,
     since those would be relative URLs to the manifest itself. Such
@@ -81796,6 +81894,9 @@
    title="">blocking</i>. <!--
    concept-appcache-onlinewhitelist-wildcard --></p></li>
 
+   <li><p>Let <var title="">cache mode flag</var> be <i
+   title="">fast</i>. <!-- concept-appcache-mode-fast --></p></li>
+
    <li><p>Let <var title="">input</var> be the decoded text of the
    manifest's byte stream.</p></li>
 
@@ -81869,6 +81970,13 @@
    title="">mode</var> to "online whitelist" and jump back to the step
    labeled "start of line".</p></li>
 
+<!--END w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+   <li><p>If <var title="">line</var> equals "SETTINGS:" (the word
+   "SETTINGS" followed by a U+003A COLON character (:)), then set <var
+   title="">mode</var> to "settings" and jump back to the step labeled
+   "start of line".</p></li>
+<!--START w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
    <li><p>If <var title="">line</var> ends with a U+003A COLON
    character (:), then set <var title="">mode</var> to "unknown" and
    jump back to the step labeled "start of line".</p></li>
@@ -82019,6 +82127,23 @@
 
      </dd>
 
+<!--END w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+     <dt>If <var title="">mode</var> is "settings"</dt>
+
+     <dd>
+
+      <p>If <var title="">tokens</var> contains a single token, and
+      that token is a <span>case-sensitive</span> match for the string
+      "<code title="">prefer-online</code>", then set <var
+      title="">cache mode flag</var> to <i title="">prefer-online</i>
+      and jump back to the step labeled "start of line".</p>
+
+      <p>Otherwise, the line is an unsupported setting: do nothing;
+      the line is ignored.</p>
+
+     </dd>
+<!--START w3c-html--><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
+
      <dt>If <var title="">mode</var> is "unknown"</dt>
 
      <dd>
@@ -82037,8 +82162,9 @@
 
    <li><p>Return the <var title="">explicit URLs</var> list, the <var
    title="">fallback URLs</var> mapping, the <var title="">online
-   whitelist namespaces</var>, and the <var title="">online whitelist
-   wildcard flag</var>.</p></li>
+   whitelist namespaces</var>, the <var title="">online whitelist
+   wildcard flag</var>, and the <var title="">cache mode
+   flag</var>.</p></li>
 
   </ol>
 
@@ -82281,9 +82407,10 @@
     <span title="concept-appcache-fallback-ns">fallback
     namespaces</span> that map to them, entries for the <span
     title="concept-appcache-onlinewhitelist">online whitelist</span>,
-    and a value for the <span
+    and values for the <span
     title="concept-appcache-onlinewhitelist-wildcard">online whitelist
-    wildcard flag</span>.</p>
+    wildcard flag</span> and the <span
+    title="concept-appcache-mode">cache mode flag</span>.</p>
 
     <p class="note">The <span>MIME type</span> of the resource is
     ignored — it is assumed to be
@@ -82741,6 +82868,10 @@
    title="concept-appcache-onlinewhitelist-wildcard">online whitelist
    wildcard flag</span> in <var title="">new cache</var>.</p></li>
 
+   <li><p>Store the value of the new <span
+   title="concept-appcache-mode">cache mode flag</span> in <var
+   title="">new cache</var>.</p></li>
+
    <li>
 
     <p>For each entry in <var title="">cache group</var>'s <span
@@ -83106,6 +83237,17 @@
     the <span title="concept-appcache-master">master</span>
     resource.</p>
 
+    <p>If there are <span title="relevant application cache">relevant
+    application caches</span> that are identified by a URL with the
+    <span>same origin</span> as the URL of <var
+    title="">document</var>, and that have this URL as one of their
+    entries, excluding entries marked as <span
+    title="concept-appcache-foreign">foreign</span>, then the user
+    agent should use the <span title="concept-appcache-selection">most
+    appropriate application cache</span> of those that match as an
+    HTTP cache for any subresource loads. User agents may also have
+    other caches in place that are also honored.</p>
+
    </dd>
 
 




More information about the Commit-Watchers mailing list