Skip to content

Commit

Permalink
[e] (0) Try to clarify fallback entries. It's not entirely clear that…
Browse files Browse the repository at this point in the history
… I did an acceptable job here, but it's a start.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=7489

git-svn-id: http://svn.whatwg.org/webapps@3952 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 22, 2009
1 parent 66276de commit 0136324
Show file tree
Hide file tree
Showing 2 changed files with 171 additions and 79 deletions.
117 changes: 78 additions & 39 deletions index
Expand Up @@ -51870,16 +51870,16 @@ clock.js</pre>

<dt><dfn id=concept-appcache-explicit title=concept-appcache-explicit>Explicit entries</dfn>

<dd>Resources that were listed in the cache's <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a>. Explicit
entries can also be marked as <dfn id=concept-appcache-foreign title=concept-appcache-foreign>foreign</dfn>, which means that they
have a <code title=attr-html-manifest><a href=#attr-html-manifest>manifest</a></code>
<dd>Resources that were listed in the cache's <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a> in an <a href=#concept-appcache-manifest-explicit title=concept-appcache-manifest-explicit>explicit
section</a>. Explicit entries can also be marked as <dfn id=concept-appcache-foreign title=concept-appcache-foreign>foreign</dfn>, which means that
they have a <code title=attr-html-manifest><a href=#attr-html-manifest>manifest</a></code>
attribute but that it doesn't point at this cache's <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a>.


<dt><dfn id=concept-appcache-fallback title=concept-appcache-fallback>Fallback entries</dfn>

<dd>Resources that were listed in the cache's <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a> as fallback
entries.
<dd>Resources that were listed in the cache's <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a> in a <a href=#concept-appcache-manifest-fallback title=concept-appcache-manifest-fallback>fallback
section</a>.


</dl><p class=note>A URL in the list can be flagged with multiple
Expand Down Expand Up @@ -52008,6 +52008,40 @@ comm.cgi
CACHE:
style/default.css</pre>

<p>It could equally well be written as follows:</p>

<pre>CACHE MANIFEST
NETWORK:
comm.cgi
CACHE:
style/default.css
images/sound-icon.png
images/background.png</pre>

<hr><p>The following manifest defines a catch-all error page that is
displayed for any page on the site while the user is offline. It
also specifies that the <a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
wildcard flag</a> is <i title="">open</i>, meaning that accesses
to resources on other sites will not be blocked. (Resources on the
same site are already not blocked because of the catch-all fallback
namespace.)</p>

<p>So long as all pages on the site reference this manifest, they
will get cached locally as they are fetched, so that subsequent hits
to the same page will load the page immediately from the
cache. Until the manifest is changed, those pages will not be
fetched from the server again. When the manifest changes, then all
the files will be redownloaded.</p>

<p>Subresources, such as style sheets, images, etc, would only be
cached using the regular HTTP caching semantics, however.</p>

<pre>CACHE MANIFEST
FALLBACK:
/ /offline.html
NETWORK:
*</pre>


<h5 id=writing-cache-manifests><span class=secno>6.9.3.2 </span>Writing cache manifests</h5>

Expand Down Expand Up @@ -52066,51 +52100,53 @@ style/default.css</pre>
possible section headers:

<dl><dt><code>CACHE:</code>
<dd>Switches to the explicit section.
<dd>Switches to the <dfn id=concept-appcache-manifest-explicit title=concept-appcache-manifest-explicit>explicit section</dfn>.

<dt><code>FALLBACK:</code>
<dd>Switches to the fallback section.
<dd>Switches to the <dfn id=concept-appcache-manifest-fallback title=concept-appcache-manifest-fallback>fallback section</dfn>.

<dt><code>NETWORK:</code>
<dd>Switches to the online whitelist section.
<dd>Switches to the <dfn id=concept-appcache-manifest-network title=concept-appcache-manifest-network>online whitelist section</dfn>.

</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)
followed by zero or more U+0020 SPACE and U+0009 CHARACTER
TABULATION (tab) characters.</p>

<p>Ironically, by default, the current section is the explicit
section.</p>
<p>Ironically, by default, the current section is the
<a href=#concept-appcache-manifest-explicit title=concept-appcache-manifest-explicit>explicit section</a>.</p>

<dt>Data for the current section
<dd>
<p>The format that data lines must take depends on the current
section.</p>

<p>When the current section is the explicit section, data lines
must consist of zero or more U+0020 SPACE and U+0009 CHARACTER
TABULATION (tab) characters, a <a href=#valid-url>valid URL</a> identifying
a resource other than the manifest itself, and then zero or more
U+0020 SPACE and U+0009 CHARACTER TABULATION (tab) characters.</p>
<p>When the current section is the <a href=#concept-appcache-manifest-explicit title=concept-appcache-manifest-explicit>explicit
section</a>, data lines must consist of zero or more U+0020
SPACE and U+0009 CHARACTER TABULATION (tab) characters, a
<a href=#valid-url>valid URL</a> identifying a resource other than the
manifest itself, and then zero or more U+0020 SPACE and U+0009
CHARACTER TABULATION (tab) characters.</p>

<p>When the current section is the online whitelist section, data
lines must consist of zero or more U+0020 SPACE and U+0009
CHARACTER TABULATION (tab) characters, either a single U+002A
ASTERISK character (*) <!--
<p>When the current section is the <a href=#concept-appcache-manifest-network title=concept-appcache-manifest-network>online whitelist
section</a>, data lines must consist of zero or more U+0020
SPACE and U+0009 CHARACTER TABULATION (tab) characters, either a
single U+002A ASTERISK character (*) <!--
concept-appcache-onlinewhitelist-wildcard --> or a <a href=#valid-url>valid
URL</a> identifying a resource other than the manifest itself,
and then zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION
(tab) characters.</p>

<p>When the current section is the fallback section, data lines
must consist of zero or more U+0020 SPACE and U+0009 CHARACTER
TABULATION (tab) characters, a <a href=#valid-url>valid URL</a> identifying
a resource other than the manifest itself, one or more U+0020
SPACE and U+0009 CHARACTER TABULATION (tab) characters, another
<p>When the current section is the <a href=#concept-appcache-manifest-fallback title=concept-appcache-manifest-fallback>fallback
section</a>, data lines must consist of zero or more U+0020
SPACE and U+0009 CHARACTER TABULATION (tab) characters, a
<a href=#valid-url>valid URL</a> identifying a resource other than the
manifest itself, and then zero or more U+0020 SPACE and U+0009
CHARACTER TABULATION (tab) characters.</p>
manifest itself, one or more U+0020 SPACE and U+0009 CHARACTER
TABULATION (tab) characters, another <a href=#valid-url>valid URL</a>
identifying a resource other than the manifest itself, and then
zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION (tab)
characters.</p>

<p class=note>The URLs in data lines can't be empty strings,
since those would be relative URLs to the manifest itself. Such
Expand All @@ -52120,10 +52156,11 @@ style/default.css</pre>
empty.</p>

<p>URLs that are to be fallback pages associated with <a href=#concept-appcache-fallback-ns title=concept-appcache-fallback-ns>fallback namespaces</a>, and
those namespaces themselves, must be given in fallback sections,
those namespaces themselves, must be given in <a href=#concept-appcache-manifest-fallback title=concept-appcache-manifest-fallback>fallback sections</a>,
with the namespace being the first URL of the data line, and the
corresponding fallback page being the second URL. All the other
pages to be cached must be listed in explicit sections.</p>
pages to be cached must be listed in <a href=#concept-appcache-manifest-explicit title=concept-appcache-manifest-explicit>explicit
sections</a>.</p>

<p><a href=#concept-appcache-fallback-ns title=concept-appcache-fallback-ns>Fallback
namespaces</a> and <a href=#concept-appcache-fallback title=concept-appcache-fallback>fallback entries</a> must have
Expand All @@ -52133,12 +52170,12 @@ style/default.css</pre>
namespace</a> must not be listed more than once.</p>

<p>URLs that the user agent is to put into the <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online whitelist</a>
must all be specified in online whitelist sections. (This is needed
for any URL that the page is intending to use to communicate back to
the server.) To specify that all URLs are automatically whitelisted
in this way, a U+002A ASTERISK character (*) character may be
specified as one of the URLs. <!--
concept-appcache-onlinewhitelist-wildcard --></p>
must all be specified in <a href=#concept-appcache-manifest-network title=concept-appcache-manifest-network>online whitelist
sections</a>. (This is needed for any URL that the page is
intending to use to communicate back to the server.) To specify that
all URLs are automatically whitelisted in this way, a U+002A
ASTERISK character (*) character may be specified as one of the
URLs. <!-- concept-appcache-onlinewhitelist-wildcard --></p>

<p>Relative URLs must be given relative to the manifest's own
URL. All URLs in the manifest must have the same <a href=#url-scheme title=url-scheme>&lt;scheme&gt;</a> as the manifest itself
Expand Down Expand Up @@ -52392,11 +52429,13 @@ style/default.css</pre>
whitelist URLs</var>, and the <var title="">online whitelist
wildcard flag</var>.</li>

</ol><p class=note>If a resource is listed in the explicit section and
matches an entry in the online whitelist, or if a resource matches
both an entry in the fallback section and the online whitelist, the
resource will taken from the cache, and the online whitelist entry
will be ignored.</p>
</ol><p class=note>If a resource is listed in the <a href=#concept-appcache-manifest-explicit title=concept-appcache-manifest-explicit>explicit section</a>
and matches an entry in the <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online whitelist</a>, or
if a resource matches both an entry in the <a href=#concept-appcache-manifest-fallback title=concept-appcache-manifest-fallback>fallback section</a>
and the <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online
whitelist</a>, the resource will taken from the cache, and the
<a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online
whitelist</a> entry will be ignored.</p>


<h4 id=updating-an-application-cache><span class=secno>6.9.4 </span>Updating an application cache</h4>
Expand Down

0 comments on commit 0136324

Please sign in to comment.