HTML and CSS Reference
In-Depth Information
The NETWORK section serves as the application's whitelist for online access. All URIs lis-
ted under this header must bypass the cache and access an online source. Wildcards can be
used.
You can also specify comments in the application cache manifest. They consist of any num-
ber of tabs or spaces followed by a single # and then followed by a string of characters.
Comments must exist on a line separate from other section headers and URIs.
Now, equipped with knowledge of the basic structure and syntax of an application cache
manifest, let's put that knowledge to work by creating one for My Tasks.
Step 2: Create the application cache manifest file for My Tasks
Your cache manifest will have a CACHE section and a NETWORK section. The CACHE
section will list the index.html, style.css, and app.js files as cacheable resources. The
NETWORK section will contain only an asterisk, the wildcard character. Create a new file
named tasks.appcache in the root directory of your web application, then add the contents
of the following listing to tasks.appcache.
Note
After entering this code listing, don't try to run the application. It will work, but you'll have
to do extra work in the final section of this chapter, “ Automating application updates ,” to
get it working correctly.
Listing 5.17. tasks.appcache—Defining resources that are available offline
In order for your application to read this file, you need to modify your HTML document
with the manifest's filename. Open index.html and replace the current opening <html>
element definition with the following:
Search WWH ::




Custom Search