HTML5 - Introduction
HTML5 - New Elements
HTML5 - Removed Elements
HTML5 - Browser Check
Tag Name : app-cache
Caching is one of the most commonly used design strategies. The goal of a caching mechanism is to reduce load on the server and to serve content faster. Today's browsers automatically offer the caching feature. This enables cached content to be viewed without having an active internet connection. So, caching also helps in offline-browsing of web content.
In HTML5, one can specify if a page needs to be cached. This is done via the tag. The 'manifest_file_name.appcache' is the name of the manifest file. Inside the manifest, one can specify the pages that needs to be cached, pages that should never be cached. The following is sample manifest file.
CACHE MANIFEST
/main.css
/lightbox.js
/button.gif

NETWORK:
featured_product.php

FALLBACK:
/products/ /show_similar_product.php
The manifest file above specifies main.css, lightbox.js, button.gif to be cached and featured_product.php to 'never' be cached. The fallback section is similar to the custom error page for the 404 page-not-found error. In this example, when a resource in the /products/ block is not found, the show_similar_product.php page is shown to the user.
The following is an example of a page using the manifest file listed above. When this web page is loaded, the browser displays a prompts 'This website (html5.generalconnection.com) is asking to store data on your computer for offline use)' with 'Allow/Never/Not Now' options available.
HTML Example :
<!DOCTYPE HTML>
<html manifest="sample_manifest_file.appcache">

<body>
This is a sample web page using the appcache feature of HTML5
</body>

</html>
Output :
This is a sample web page using the appcache feature of HTML5

© 2010 www.generalconnection.com. All rights reserved. | www.generalconnection.com