The cache manifest file consists of three section headers. • Explicit section with the header CACHE. • Online
whitelist section with the header NETWORK. • Fallback section with the header FALLBACK. Note: Example 1 and Example 2 above, do not indicate any section header and are therefore considered an explicit section by default.
Online whitelist section with the header NETWORK Example 3: CACHE MANIFEST NETWORK: /checking.cgi CACHE: /test.css /test.js /test.png This example consists of headers. The line, NETWORK: is the start of the "online whitelist" section. The resources listed under this section are never cached and are not available offline. As a result, an error will occur when an attempt is made offline to load the resource. There is a shift to the explicit section by the header CACHE: and the resources (the CSS stylesheet, JavaScript and the image file) can be downloaded and used offline.
Fallback section with the header FALLBACK The fallback section in a cache manifest file can be used to substitute online resources that cannot be cached or were not cached successfully.
Example 4: CACHE MANIFEST FALLBACK: / /offline.html NETWORK: … In Example 4, the fallback section consists of a single line. i.e.,
/ /offline.html. The single character (
/) before ‘offline’ will match any URL pattern on one's site. If the browser does not find the page in the appcache, the application will display the page /offline.html. == Event flow ==