*** Welcome to piglix ***

Application cache

Filename extension .appcache
Internet media type text/cache-manifest
Developed by World Wide Web Consortium
Standard HTML5
Open format? Yes
Website html.spec.whatwg.org/multipage/browsers.html#offline

The cache manifest in HTML5 is a software storage feature which provides the ability to access a web application even without a network connection. It became part of the W3C Recommendation on 28 October 2014. According to HTML Living Standard it will be replaced.


Web applications consist of web pages that need to be downloaded from a network. For this to happen there must be a network connection. However, there are many instances when users cannot connect to a network due to circumstances beyond their control. HTML5 provides the ability to access the web application even without a network connection using the cache manifest.

Web applications consist of resources identified by URLs. These can be HTML, CSS, JavaScript, images or any other source that is required for a web application to be rendered. Their addresses can be copied into a manifest file, which can be updated regularly by the author of the web application, indicating any new web addresses that are added or deleted. When connecting to a network for the first time, a web browser will read the HTML5 manifest file, download the resources given and store them locally. Then, in the absence of a network connection, the web browser will shift to the local copies instead and render the web application offline.

In order for the offline applications to work, a cache manifest file must be created by the web developer. If the web application exceeds more than one page then each page must have a manifest attribute that points to the cache manifest. Every page referencing the manifest will be stored locally. The cache manifest file is a text file located in another part of the server. It must be served with the following content type:

The following line must be added to the html element in order for the cache manifest file to work.

The argument to the manifest attribute is a relative or absolute path to the manifest file.

Consider the HTML file given below. The <html> element indicates a file named cache.appcache will contain the list of resources (i.e., test.js, test.css) needed for this web page to work offline. Common names for this file are cache.manifest and manifest.appcache.

Given below is a list of some rules and syntax required when writing the manifest file.

Given below is an example of a cache manifest file.


...
Wikipedia

...