<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kaizou &#187; cache-manifest</title>
	<atom:link href="http://www.kaizou.org/tag/cache-manifest/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kaizou.org</link>
	<description>This is Web 2.71828</description>
	<lastBuildDate>Thu, 24 Nov 2011 09:34:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HTML 5 offline web applications</title>
		<link>http://www.kaizou.org/2009/04/html-5-offline-web-applications/</link>
		<comments>http://www.kaizou.org/2009/04/html-5-offline-web-applications/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 17:21:21 +0000</pubDate>
		<dc:creator>David Corvoysier</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[cache-manifest]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.kaizou.org/?p=355</guid>
		<description><![CDATA[HTML 5 provides a new caching feature to support offline web applications. Basically, you can specify in a specific file called the &#8220;cache manifest&#8221; the caching policy to apply to a particular web page. To activate the HTML 5 caching feature for a specific document, you only need to specify the URI of the cache [...]]]></description>
			<content:encoded><![CDATA[<p>HTML 5 provides a new caching feature to support <a href="http://www.w3.org/TR/offline-webapps/" alt="HTML 5 offline web applications">offline web applications</a>.</p>
<p>Basically, you can specify in a specific file called the &#8220;cache manifest&#8221; the caching policy to apply to a particular web page.</p>
<p>To activate the HTML 5 caching feature for a specific document, you only need to specify the URI of the cache manifest file in the <code>manifest</code> attribute of the <code>&lt;html&gt;</code> element.</p>
<pre>
<code>&lt;!DOCTYPE HTML&gt;
&lt;html manifest="myapp.cache"&gt;
...</code>
</pre>
<p>The file that references the cache manifest file is called the <a href="http://www.whatwg.org/specs/web-apps/current-work/#concept-appcache-master" alt="HTML 5 cache master entry">master entry</a>.</p>
<p>Please note that to be properly parsed by the browser, the manifest file must have a <code>text/cache-manifest</code> MIME type (which means that you will need either to add a custom file type extension binding to your web server or to specify manually the mime-type, for instance using PHP <code>header</code> directive).</p>
<p>A cache manifest file typically looks like this:</p>
<pre>
<code>CACHE MANIFEST
index.html
style.css
images/logo.png

NETWORK:
search.php</code>
</pre>
<p>This file specifies several files to cache (the cache <a href="http://www.whatwg.org/specs/web-apps/current-work/#concept-appcache-explicit" alt="HTML 5 cache explicit entries">explicit entries</a>), and then specifies that search.php should never be cached (it is said to belong to the <a href="http://www.whatwg.org/specs/web-apps/current-work/#concept-appcache-onlinewhitelist" alt="HTML 5 cache online white-list">online white list</a>), so that any attempt to access that file will bypass the cache.</p>
<p>Whenever the user browses to the page corresponding to a document to which a cache manifest is associated, the browser must check on the server if the latter has been modified:</p>
<ul>
<li>If it hasn&#8217;t, then the cached content is used,</li>
<li>If a new version of the cache manifest exists, then the cached content is considered as staled and reloaded from the server.</li>
</ul>
<p>The cache manifest for a document may also contain <a href="http://www.whatwg.org/specs/web-apps/current-work/#concept-appcache-fallback" alt="HTML 5 cache fallback entries">fallback entries</a> that can be used if the browser can&#8217;t retrieve the original content. Below is an example where a static image is used when the retrieval of a dynamically generated image fails:</p>
<pre>
<code>CACHE MANIFEST
FALLBACK:
images/mirror-effect.php server-busy.jpg</code>
</pre>
<p>HTML 5 also defines an <a href="http://www.whatwg.org/specs/web-apps/current-work/#application-cache-api" alt="HTML 5 application cache API">application cache API</a> to manually trigger cache updates:</p>
<ul>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/#dom-appcache-update" alt="HTML 5 cache update method"><code>update()</code></a>: updates the cache for the current document in the background,</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/#dom-appcache-swapcache" alt="HTML 5 swap cache method"><code>swapCache()</code></a>: reflow the HTML document using updated cached content,</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/#handler-appcache-onupdateready" alt="HTML 5 cache updateready event"><code>onupdateready()</code></a>: event triggered when the cache content has been updated,</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/#handler-appcache-onobsolete" alt="HTML 5 cache obsolete event"><code>onobsolete()</code></a>: event triggered when the cache content has been marked as obsolete,</li>
<li>&#8230;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.kaizou.org/2009/04/html-5-offline-web-applications/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

