Skip to content

Commit

Permalink
[e] (0) Add an example of absolute URLs in appcaches.
Browse files Browse the repository at this point in the history
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10499

git-svn-id: http://svn.whatwg.org/webapps@5492 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 25, 2010
1 parent 46a27cf commit fdc7903
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 73 deletions.
72 changes: 49 additions & 23 deletions complete.html
Expand Up @@ -880,7 +880,7 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
<li><a href=#appcache><span class=secno>6.6.2 </span>Application caches</a></li>
<li><a href=#manifests><span class=secno>6.6.3 </span>The cache manifest syntax</a>
<ol>
<li><a href=#a-sample-manifest><span class=secno>6.6.3.1 </span>A sample manifest</a></li>
<li><a href=#some-sample-manifests><span class=secno>6.6.3.1 </span>Some sample manifests</a></li>
<li><a href=#writing-cache-manifests><span class=secno>6.6.3.2 </span>Writing cache manifests</a></li>
<li><a href=#parsing-cache-manifests><span class=secno>6.6.3.3 </span>Parsing cache manifests</a></ol></li>
<li><a href=#downloading-or-updating-an-application-cache><span class=secno>6.6.4 </span>Downloading or updating an application cache</a></li>
Expand Down Expand Up @@ -62339,14 +62339,16 @@ <h4 id=appcache><span class=secno>6.6.2 </span>Application caches</h4>
<h4 id=manifests><span class=secno>6.6.3 </span>The cache manifest syntax</h4>


<h5 id=a-sample-manifest><span class=secno>6.6.3.1 </span>A sample manifest</h5>
<h5 id=some-sample-manifests><span class=secno>6.6.3.1 </span>Some sample manifests</h5>

<p><i>This section is non-normative.</i></p>

<p>This example manifest requires two images and a style sheet to be
cached and whitelists a CGI script.</p>
<div class=example>

<pre>CACHE MANIFEST
<p>This example manifest requires two images and a style sheet to be
cached and whitelists a CGI script.</p>

<pre>CACHE MANIFEST
# the above line is required

# this is a comment
Expand Down Expand Up @@ -62374,40 +62376,64 @@ <h5 id=a-sample-manifest><span class=secno>6.6.3.1 </span>A sample manifest</h5>
CACHE:
style/default.css</pre>

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

<pre>CACHE MANIFEST
<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>
</div>

<div class=example>

<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>Offline application cache manifests can use absolute paths or
even absolute URLs:</p>

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

<pre>CACHE MANIFEST
/main/home
/main/app.js
/settings/home
/settings/app.js
http://img.example.com/logo.png
http://img.example.com/check.png
http://img.example.com/cross.png</pre>

</div>

<div class=example>

<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>

</div>



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

Expand Down
72 changes: 49 additions & 23 deletions index
Expand Up @@ -887,7 +887,7 @@
<li><a href=#appcache><span class=secno>6.6.2 </span>Application caches</a></li>
<li><a href=#manifests><span class=secno>6.6.3 </span>The cache manifest syntax</a>
<ol>
<li><a href=#a-sample-manifest><span class=secno>6.6.3.1 </span>A sample manifest</a></li>
<li><a href=#some-sample-manifests><span class=secno>6.6.3.1 </span>Some sample manifests</a></li>
<li><a href=#writing-cache-manifests><span class=secno>6.6.3.2 </span>Writing cache manifests</a></li>
<li><a href=#parsing-cache-manifests><span class=secno>6.6.3.3 </span>Parsing cache manifests</a></ol></li>
<li><a href=#downloading-or-updating-an-application-cache><span class=secno>6.6.4 </span>Downloading or updating an application cache</a></li>
Expand Down Expand Up @@ -62328,14 +62328,16 @@ clock.js</pre>
<h4 id=manifests><span class=secno>6.6.3 </span>The cache manifest syntax</h4>


<h5 id=a-sample-manifest><span class=secno>6.6.3.1 </span>A sample manifest</h5>
<h5 id=some-sample-manifests><span class=secno>6.6.3.1 </span>Some sample manifests</h5>

<p><i>This section is non-normative.</i></p>

<p>This example manifest requires two images and a style sheet to be
cached and whitelists a CGI script.</p>
<div class=example>

<pre>CACHE MANIFEST
<p>This example manifest requires two images and a style sheet to be
cached and whitelists a CGI script.</p>

<pre>CACHE MANIFEST
# the above line is required

# this is a comment
Expand Down Expand Up @@ -62363,40 +62365,64 @@ comm.cgi
CACHE:
style/default.css</pre>

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

<pre>CACHE MANIFEST
<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>
</div>

<div class=example>

<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>Offline application cache manifests can use absolute paths or
even absolute URLs:</p>

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

<pre>CACHE MANIFEST
/main/home
/main/app.js
/settings/home
/settings/app.js
http://img.example.com/logo.png
http://img.example.com/check.png
http://img.example.com/cross.png</pre>

</div>

<div class=example>

<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>

</div>



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

Expand Down
78 changes: 51 additions & 27 deletions source
Expand Up @@ -70499,14 +70499,16 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
<h4 id="manifests">The cache manifest syntax</h4>


<h5>A sample manifest</h5>
<h5>Some sample manifests</h5>

<p><i>This section is non-normative.</i></p>

<p>This example manifest requires two images and a style sheet to be
cached and whitelists a CGI script.</p>
<div class="example">

<p>This example manifest requires two images and a style sheet to be
cached and whitelists a CGI script.</p>

<pre>CACHE MANIFEST
<pre>CACHE MANIFEST
# the above line is required

# this is a comment
Expand Down Expand Up @@ -70534,43 +70536,65 @@ comm.cgi
CACHE:
style/default.css</pre>

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

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

<hr>
</div>

<div class="example">

<p>Offline application cache manifests can use absolute paths or
even absolute URLs:</p>

<pre>CACHE MANIFEST

/main/home
/main/app.js
/settings/home
/settings/app.js
http://img.example.com/logo.png
http://img.example.com/check.png
http://img.example.com/cross.png</pre>

<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 <span
title="concept-appcache-onlinewhitelist-wildcard">online whitelist
wildcard flag</span> 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
</div>

<div class="example">

<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 <span
title="concept-appcache-onlinewhitelist-wildcard">online whitelist
wildcard flag</span> 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>

</div>



<h5>Writing cache manifests</h5>

Expand Down

0 comments on commit fdc7903

Please sign in to comment.